diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-08-08 17:32:43 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-08-08 17:32:43 +0000 |
| commit | 43dc21b53e642208542398d7d257d0f9cb48582f (patch) | |
| tree | 75510653a1989316dad1df9b3d9bc9230264281c /src/display | |
| parent | Fixed svg-path (and display/curve) tests to properly handle closepath and mad... (diff) | |
| download | inkscape-43dc21b53e642208542398d7d257d0f9cb48582f.tar.gz inkscape-43dc21b53e642208542398d7d257d0f9cb48582f.zip | |
remove many unnecessary to_2geom and from_2geom calls
(bzr r6593)
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/canvas-bpath.cpp | 8 | ||||
| -rw-r--r-- | src/display/inkscape-cairo.cpp | 4 | ||||
| -rw-r--r-- | src/display/nr-arena-glyphs.cpp | 2 | ||||
| -rw-r--r-- | src/display/nr-arena-shape.cpp | 18 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/display/canvas-bpath.cpp b/src/display/canvas-bpath.cpp index 5f1262ced..0daf6e69a 100644 --- a/src/display/canvas-bpath.cpp +++ b/src/display/canvas-bpath.cpp @@ -144,7 +144,7 @@ sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i cbp->affine = affine; - Geom::Rect bbox = bounds_exact_transformed(cbp->curve->get_pathvector(), to_2geom(affine)); + Geom::Rect bbox = bounds_exact_transformed(cbp->curve->get_pathvector(), affine); item->x1 = (int)bbox.min()[Geom::X] - 1; item->y1 = (int)bbox.min()[Geom::Y] - 1; @@ -178,9 +178,9 @@ sp_canvas_bpath_render (SPCanvasItem *item, SPCanvasBuf *buf) cairo_new_path(buf->ct); if (!dofill) - feed_pathvector_to_cairo (buf->ct, cbp->curve->get_pathvector(), to_2geom(cbp->affine), area, true, 1); + feed_pathvector_to_cairo (buf->ct, cbp->curve->get_pathvector(), cbp->affine, area, true, 1); else - feed_pathvector_to_cairo (buf->ct, cbp->curve->get_pathvector(), to_2geom(cbp->affine), area, false, 1); + feed_pathvector_to_cairo (buf->ct, cbp->curve->get_pathvector(), cbp->affine, area, false, 1); if (dofill) { // RGB / BGR @@ -218,7 +218,7 @@ sp_canvas_bpath_point (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_it Geom::Rect viewbox = to_2geom(item->canvas->getViewbox()); viewbox.expandBy (width); double dist = NR_HUGE; - pathv_matrix_point_bbox_wind_distance(cbp->curve->get_pathvector(), to_2geom(cbp->affine), to_2geom(p), NULL, NULL, &dist, 0.5, &viewbox); + pathv_matrix_point_bbox_wind_distance(cbp->curve->get_pathvector(), cbp->affine, p, NULL, NULL, &dist, 0.5, &viewbox); if (dist <= 1.0) { *actual_item = item; diff --git a/src/display/inkscape-cairo.cpp b/src/display/inkscape-cairo.cpp index 33a84d508..4895418f0 100644 --- a/src/display/inkscape-cairo.cpp +++ b/src/display/inkscape-cairo.cpp @@ -178,10 +178,10 @@ feed_path_to_cairo (cairo_t *ct, Geom::Path const &path, Geom::Matrix trans, boo return; // Transform all coordinates to coords within "area" - Geom::Point shift = to_2geom(area->min()); + Geom::Point shift = area->min(); NR::Rect view = *area; view.growBy (stroke_width); - view = view * from_2geom(Geom::Translate(-shift)); + view = view * (NR::Matrix)Geom::Translate(-shift); // Pass transformation to feed_curve, so that we don't need to create a whole new path. Geom::Matrix transshift(trans * Geom::Translate(-shift)); diff --git a/src/display/nr-arena-glyphs.cpp b/src/display/nr-arena-glyphs.cpp index a1a14ef1a..0216fe4f9 100644 --- a/src/display/nr-arena-glyphs.cpp +++ b/src/display/nr-arena-glyphs.cpp @@ -465,7 +465,7 @@ nr_arena_glyphs_group_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPi Geom::PathVector const * pathv = g->font->PathVector(g->glyph); cairo_new_path(ct); - Geom::Matrix transform = to_2geom(g->g_transform * group->ctm); + Geom::Matrix transform = g->g_transform * group->ctm; feed_pathvector_to_cairo (ct, *pathv, transform, (pb->area).upgrade(), false, 0); cairo_fill(ct); pb->empty = FALSE; diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp index 60795becf..554ea2dc9 100644 --- a/src/display/nr-arena-shape.cpp +++ b/src/display/nr-arena-shape.cpp @@ -255,7 +255,7 @@ nr_arena_shape_update(NRArenaItem *item, NRRectL *area, NRGC *gc, guint state, g shape->ctm = gc->transform; if (state & NR_ARENA_ITEM_STATE_BBOX) { if (shape->curve) { - boundingbox = bounds_exact_transformed(shape->curve->get_pathvector(), to_2geom(gc->transform)); + boundingbox = bounds_exact_transformed(shape->curve->get_pathvector(), gc->transform); item->bbox.x0 = (gint32)(boundingbox[0][0] - 1.0F); item->bbox.y0 = (gint32)(boundingbox[1][0] - 1.0F); item->bbox.x1 = (gint32)(boundingbox[0][1] + 1.9999F); @@ -278,7 +278,7 @@ nr_arena_shape_update(NRArenaItem *item, NRRectL *area, NRGC *gc, guint state, g bool outline = (NR_ARENA_ITEM(shape)->arena->rendermode == Inkscape::RENDERMODE_OUTLINE); if (shape->curve) { - boundingbox = bounds_exact_transformed(shape->curve->get_pathvector(), to_2geom(gc->transform)); + boundingbox = bounds_exact_transformed(shape->curve->get_pathvector(), gc->transform); if (shape->_stroke.paint.type() != NRArenaShape::Paint::NONE || outline) { float width, scale; @@ -465,7 +465,7 @@ nr_arena_shape_update_fill(NRArenaShape *shape, NRGC *gc, NRRectL *area, bool fo Path* thePath=new Path; Shape* theShape=new Shape; { - Geom::Matrix tempMat(to_2geom(gc->transform)); + Geom::Matrix tempMat(gc->transform); thePath->LoadPathVector(shape->curve->get_pathvector(), tempMat, true); } @@ -580,7 +580,7 @@ nr_arena_shape_update_stroke(NRArenaShape *shape,NRGC* gc, NRRectL *area) Path* thePath = new Path; Shape* theShape = new Shape; { - Geom::Matrix tempMat( to_2geom(gc->transform) ); + Geom::Matrix tempMat( gc->transform ); thePath->LoadPathVector(shape->curve->get_pathvector(), tempMat, true); } @@ -732,7 +732,7 @@ cairo_arena_shape_render_outline(cairo_t *ct, NRArenaItem *item, boost::optional cairo_set_tolerance(ct, 1.25); // low quality, but good enough for outline mode cairo_new_path(ct); - feed_pathvector_to_cairo (ct, shape->curve->get_pathvector(), to_2geom(shape->ctm), area, true, 0); + feed_pathvector_to_cairo (ct, shape->curve->get_pathvector(), shape->ctm, area, true, 0); cairo_stroke(ct); @@ -813,7 +813,7 @@ cairo_arena_shape_render_stroke(NRArenaItem *item, NRRectL *area, NRPixBlock *pb cairo_set_tolerance(ct, 0.1); cairo_new_path(ct); - feed_pathvector_to_cairo (ct, shape->curve->get_pathvector(), to_2geom(shape->ctm), area->upgrade(), true, style_width); + feed_pathvector_to_cairo (ct, shape->curve->get_pathvector(), shape->ctm, area->upgrade(), true, style_width); cairo_stroke(ct); @@ -988,7 +988,7 @@ cairo_arena_shape_clip(NRArenaItem *item, NRRectL *area, NRPixBlock *pb) cairo_new_path(ct); - feed_pathvector_to_cairo (ct, shape->curve->get_pathvector(), to_2geom(shape->ctm), (area)->upgrade(), false, 0); + feed_pathvector_to_cairo (ct, shape->curve->get_pathvector(), shape->ctm, (area)->upgrade(), false, 0); cairo_fill(ct); @@ -1096,9 +1096,9 @@ nr_arena_shape_pick(NRArenaItem *item, NR::Point p, double delta, unsigned int / if (item->arena->canvasarena) { Geom::Rect viewbox = to_2geom(item->arena->canvasarena->item.canvas->getViewbox()); viewbox.expandBy (width); - pathv_matrix_point_bbox_wind_distance(shape->curve->get_pathvector(), to_2geom(shape->ctm), to_2geom(p), NULL, needfill? &wind : NULL, &dist, 0.5, &viewbox); + pathv_matrix_point_bbox_wind_distance(shape->curve->get_pathvector(), shape->ctm, p, NULL, needfill? &wind : NULL, &dist, 0.5, &viewbox); } else { - pathv_matrix_point_bbox_wind_distance(shape->curve->get_pathvector(), to_2geom(shape->ctm), to_2geom(p), NULL, needfill? &wind : NULL, &dist, 0.5, NULL); + pathv_matrix_point_bbox_wind_distance(shape->curve->get_pathvector(), shape->ctm, p, NULL, needfill? &wind : NULL, &dist, 0.5, NULL); } g_get_current_time (&tfinish); |
