diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-07-25 01:06:47 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-07-25 01:06:47 +0000 |
| commit | 4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3 (patch) | |
| tree | 75853d8eec5e85fb93a2a798b57f072e3c9eeb99 /src/sp-rect.cpp | |
| parent | Replace direct use of Cairo contexts and surfaces in the rendering tree (diff) | |
| parent | Revert workarounds from 10501 - no longer necessary (diff) | |
| download | inkscape-4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3.tar.gz inkscape-4f3cc7cbb73a72e1ab10a587a3b81f8c8737fec3.zip | |
Merge from trunk
(bzr r10347.1.18)
Diffstat (limited to 'src/sp-rect.cpp')
| -rw-r--r-- | src/sp-rect.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index db5a62f8f..467b37d17 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -417,7 +417,7 @@ sp_rect_set_visible_rx(SPRect *rect, gdouble rx) rect->rx.computed = rx / vector_stretch( Geom::Point(rect->x.computed + 1, rect->y.computed), Geom::Point(rect->x.computed, rect->y.computed), - SP_ITEM(rect)->transform); + rect->transform); rect->rx._set = true; } SP_OBJECT(rect)->updateRepr(); @@ -433,7 +433,7 @@ sp_rect_set_visible_ry(SPRect *rect, gdouble ry) rect->ry.computed = ry / vector_stretch( Geom::Point(rect->x.computed, rect->y.computed + 1), Geom::Point(rect->x.computed, rect->y.computed), - SP_ITEM(rect)->transform); + rect->transform); rect->ry._set = true; } SP_OBJECT(rect)->updateRepr(); @@ -447,7 +447,7 @@ sp_rect_get_visible_rx(SPRect *rect) return rect->rx.computed * vector_stretch( Geom::Point(rect->x.computed + 1, rect->y.computed), Geom::Point(rect->x.computed, rect->y.computed), - SP_ITEM(rect)->transform); + rect->transform); } gdouble @@ -458,7 +458,7 @@ sp_rect_get_visible_ry(SPRect *rect) return rect->ry.computed * vector_stretch( Geom::Point(rect->x.computed, rect->y.computed + 1), Geom::Point(rect->x.computed, rect->y.computed), - SP_ITEM(rect)->transform); + rect->transform); } Geom::Rect @@ -481,9 +481,9 @@ sp_rect_compensate_rxry(SPRect *rect, Geom::Affine xform) Geom::Point cy = c + Geom::Point(0, 1); // apply previous transform if any - c *= SP_ITEM(rect)->transform; - cx *= SP_ITEM(rect)->transform; - cy *= SP_ITEM(rect)->transform; + c *= rect->transform; + cx *= rect->transform; + cy *= rect->transform; // find out stretches that we need to compensate gdouble eX = vector_stretch(cx, c, xform); @@ -513,7 +513,7 @@ sp_rect_set_visible_width(SPRect *rect, gdouble width) rect->width.computed = width / vector_stretch( Geom::Point(rect->x.computed + 1, rect->y.computed), Geom::Point(rect->x.computed, rect->y.computed), - SP_ITEM(rect)->transform); + rect->transform); rect->width._set = true; SP_OBJECT(rect)->updateRepr(); } @@ -524,7 +524,7 @@ sp_rect_set_visible_height(SPRect *rect, gdouble height) rect->height.computed = height / vector_stretch( Geom::Point(rect->x.computed, rect->y.computed + 1), Geom::Point(rect->x.computed, rect->y.computed), - SP_ITEM(rect)->transform); + rect->transform); rect->height._set = true; SP_OBJECT(rect)->updateRepr(); } @@ -537,7 +537,7 @@ sp_rect_get_visible_width(SPRect *rect) return rect->width.computed * vector_stretch( Geom::Point(rect->x.computed + 1, rect->y.computed), Geom::Point(rect->x.computed, rect->y.computed), - SP_ITEM(rect)->transform); + rect->transform); } gdouble @@ -548,7 +548,7 @@ sp_rect_get_visible_height(SPRect *rect) return rect->height.computed * vector_stretch( Geom::Point(rect->x.computed, rect->y.computed + 1), Geom::Point(rect->x.computed, rect->y.computed), - SP_ITEM(rect)->transform); + rect->transform); } /** @@ -573,12 +573,12 @@ static void sp_rect_snappoints(SPItem const *item, std::vector<Inkscape::SnapCan SPRect *rect = SP_RECT(item); - Geom::Affine const i2d (item->i2d_affine ()); + Geom::Affine const i2dt (item->i2dt_affine ()); - Geom::Point p0 = Geom::Point(rect->x.computed, rect->y.computed) * i2d; - Geom::Point p1 = Geom::Point(rect->x.computed, rect->y.computed + rect->height.computed) * i2d; - Geom::Point p2 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed) * i2d; - Geom::Point p3 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed) * i2d; + Geom::Point p0 = Geom::Point(rect->x.computed, rect->y.computed) * i2dt; + Geom::Point p1 = Geom::Point(rect->x.computed, rect->y.computed + rect->height.computed) * i2dt; + Geom::Point p2 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed) * i2dt; + Geom::Point p3 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed) * i2dt; if (snapprefs->getSnapToItemNode()) { p.push_back(Inkscape::SnapCandidatePoint(p0, Inkscape::SNAPSOURCE_CORNER, Inkscape::SNAPTARGET_CORNER)); @@ -606,25 +606,25 @@ sp_rect_convert_to_guides(SPItem *item) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (!prefs->getBool("/tools/shapes/rect/convertguides", true)) { - SP_ITEM(rect)->convert_to_guides(); + rect->convert_to_guides(); return; } std::list<std::pair<Geom::Point, Geom::Point> > pts; - Geom::Affine const i2d (SP_ITEM(rect)->i2d_affine()); + Geom::Affine const i2dt(rect->i2dt_affine()); - Geom::Point A1(Geom::Point(rect->x.computed, rect->y.computed) * i2d); - Geom::Point A2(Geom::Point(rect->x.computed, rect->y.computed + rect->height.computed) * i2d); - Geom::Point A3(Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed) * i2d); - Geom::Point A4(Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed) * i2d); + Geom::Point A1(Geom::Point(rect->x.computed, rect->y.computed) * i2dt); + Geom::Point A2(Geom::Point(rect->x.computed, rect->y.computed + rect->height.computed) * i2dt); + Geom::Point A3(Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed) * i2dt); + Geom::Point A4(Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed) * i2dt); pts.push_back(std::make_pair(A1, A2)); pts.push_back(std::make_pair(A2, A3)); pts.push_back(std::make_pair(A3, A4)); pts.push_back(std::make_pair(A4, A1)); - sp_guide_pt_pairs_to_guides(inkscape_active_desktop(), pts); + sp_guide_pt_pairs_to_guides(item->document, pts); } /* |
