~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/sp-item-transform.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:
38
38
void
39
39
sp_item_scale_rel (SPItem *item, Geom::Scale const &scale)
40
40
{
41
 
    boost::optional<Geom::Rect> bbox = sp_item_bbox_desktop(item);
 
41
    Geom::OptRect bbox = sp_item_bbox_desktop(item);
42
42
    if (bbox) {
43
43
        Geom::Translate const s(bbox->midpoint()); // use getCenter?
44
44
        sp_item_set_i2d_affine(item, sp_item_i2d_affine(item) * s.inverse() * scale * s);
95
95
    gdouble h1 = y1 - y0;
96
96
    gdouble r0 = strokewidth;
97
97
 
98
 
    if (bbox.isEmpty()) {
 
98
    if (bbox.hasZeroArea()) {
99
99
        Geom::Matrix move = Geom::Translate(x0 - bbox.min()[Geom::X], y0 - bbox.min()[Geom::Y]);
100
100
        return (move); // cannot scale from empty boxes at all, so only translate
101
101
    }
158
158
}
159
159
 
160
160
Geom::Rect
161
 
get_visual_bbox (boost::optional<Geom::Rect> const &initial_geom_bbox, Geom::Matrix const &abs_affine, gdouble const initial_strokewidth, bool const transform_stroke)
 
161
get_visual_bbox (Geom::OptRect const &initial_geom_bbox, Geom::Matrix const &abs_affine, gdouble const initial_strokewidth, bool const transform_stroke)
162
162
{
163
163
    
164
164
    g_assert(initial_geom_bbox);