From 688effa1c3eb4c41498a59e2e0c67bd2b44e90ab Mon Sep 17 00:00:00 2001 From: johanengelen Date: Thu, 26 Jun 2008 23:09:58 +0000 Subject: [PATCH] use 2geom path for bbox calculation. (gets rid of yet another reference to old nartbpath in spcurve!) --- src/display/canvas-bpath.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/display/canvas-bpath.cpp b/src/display/canvas-bpath.cpp index e050591d7..ac3779029 100644 --- a/src/display/canvas-bpath.cpp +++ b/src/display/canvas-bpath.cpp @@ -118,15 +118,12 @@ sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i cbp->affine = affine; - const_NRBPath bp; - bp.path = cbp->curve->get_bpath(); - NRRect bbox; - nr_path_matrix_bbox_union(&bp, affine, &bbox); - - item->x1 = (int)bbox.x0 - 1; - item->y1 = (int)bbox.y0 - 1; - item->x2 = (int)bbox.x1 + 1; - item->y2 = (int)bbox.y1 + 1; + Geom::Rect bbox = bounds_exact_transformed(cbp->curve->get_pathvector(), to_2geom(affine)); + + item->x1 = (int)bbox.min()[Geom::X] - 1; + item->y1 = (int)bbox.min()[Geom::Y] - 1; + item->x2 = (int)bbox.max()[Geom::X] + 1; + item->y2 = (int)bbox.max()[Geom::Y] + 1; sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2); } -- 2.30.2