~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/gradient-chemistry.cpp

  • Committer: Ted Gould
  • Date: 2008-11-21 05:24:08 UTC
  • Revision ID: ted@canonical.com-20081121052408-tilucis2pjrrpzxx
MergeĀ fromĀ fe-moved

Show diffs side-by-side

added added

removed removed

Lines of Context:
285
285
 
286
286
    // calculate the bbox of the item
287
287
    sp_document_ensure_up_to_date(SP_OBJECT_DOCUMENT(item));
288
 
    boost::optional<Geom::Rect> bbox = item->getBounds(Geom::identity()); // we need "true" bbox without item_i2d_affine
 
288
    Geom::OptRect bbox = item->getBounds(Geom::identity()); // we need "true" bbox without item_i2d_affine
289
289
 
290
 
    if ( !bbox || bbox->isEmpty() )
 
290
    if (!bbox)
291
291
        return gr;
292
292
 
293
293
    Geom::Coord const width = bbox->dimensions()[Geom::X];
346
346
        // calculate the bbox of the item
347
347
        sp_document_ensure_up_to_date(SP_OBJECT_DOCUMENT(item));
348
348
        Geom::Matrix bbox2user;
349
 
        boost::optional<Geom::Rect> bbox = item->getBounds(Geom::identity()); // we need "true" bbox without item_i2d_affine
350
 
        if ( bbox && !bbox->isEmpty() ) {
 
349
        Geom::OptRect bbox = item->getBounds(Geom::identity()); // we need "true" bbox without item_i2d_affine
 
350
        if ( bbox ) {
351
351
            bbox2user = Geom::Matrix(bbox->dimensions()[Geom::X], 0,
352
352
                                   0, bbox->dimensions()[Geom::Y],
353
353
                                   bbox->min()[Geom::X], bbox->min()[Geom::Y]);
1098
1098
 
1099
1099
    if (SP_GRADIENT(gradient)->units == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
1100
1100
        sp_document_ensure_up_to_date(SP_OBJECT_DOCUMENT(item));
1101
 
        boost::optional<Geom::Rect> bbox = item->getBounds(Geom::identity()); // we need "true" bbox without item_i2d_affine
 
1101
        Geom::OptRect bbox = item->getBounds(Geom::identity()); // we need "true" bbox without item_i2d_affine
1102
1102
        if (bbox) {
1103
1103
            p *= Geom::Matrix(bbox->dimensions()[Geom::X], 0,
1104
1104
                            0, bbox->dimensions()[Geom::Y],