From: buliabyak Date: Mon, 9 Mar 2009 00:48:46 +0000 (+0000) Subject: do not redraw if moved to the same point as before X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5d6624b2e1801d75852880caec73f6a5671ab1a4;p=inkscape.git do not redraw if moved to the same point as before --- diff --git a/src/display/sodipodi-ctrl.cpp b/src/display/sodipodi-ctrl.cpp index c26402743..caa5fa697 100644 --- a/src/display/sodipodi-ctrl.cpp +++ b/src/display/sodipodi-ctrl.cpp @@ -111,6 +111,8 @@ sp_ctrl_init (SPCtrl *ctrl) ctrl->box.x0 = ctrl->box.y0 = ctrl->box.x1 = ctrl->box.y1 = 0; ctrl->cache = NULL; ctrl->pixbuf = NULL; + + ctrl->_point = Geom::Point(0,0); } static void @@ -550,8 +552,11 @@ sp_ctrl_render (SPCanvasItem *item, SPCanvasBuf *buf) } void SPCtrl::moveto (Geom::Point const p) { - sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (this), Geom::Matrix(Geom::Translate (p))); - _moved = true; + if (p != _point) { + sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (this), Geom::Matrix(Geom::Translate (p))); + _moved = true; + } + _point = p; } diff --git a/src/display/sodipodi-ctrl.h b/src/display/sodipodi-ctrl.h index 634e9ff3e..859735e4f 100644 --- a/src/display/sodipodi-ctrl.h +++ b/src/display/sodipodi-ctrl.h @@ -54,6 +54,7 @@ struct SPCtrl : public SPCanvasItem{ GdkPixbuf * pixbuf; void moveto(Geom::Point const p); + Geom::Point _point; }; struct SPCtrlClass : public SPCanvasItemClass{