From 38c66b7ac5397f2a6cbf6b2a5f713a5e5d743783 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Sat, 16 Jul 2011 22:10:13 +0200 Subject: Fix drawing of controls at (0,0) (e.g. scaling handles, snap-indicator, etc.). See lp:360158 Fixed bugs: - https://launchpad.net/bugs/360158 (bzr r10463) --- src/display/sodipodi-ctrl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/display/sodipodi-ctrl.cpp') diff --git a/src/display/sodipodi-ctrl.cpp b/src/display/sodipodi-ctrl.cpp index 0ff7ca9f5..b4d2633bb 100644 --- a/src/display/sodipodi-ctrl.cpp +++ b/src/display/sodipodi-ctrl.cpp @@ -105,7 +105,12 @@ sp_ctrl_init (SPCtrl *ctrl) ctrl->stroked = 0; ctrl->fill_color = 0x000000ff; ctrl->stroke_color = 0x000000ff; - ctrl->_moved = false; + + // This way we make sure that the first sp_ctrl_update() call finishes properly; + // in subsequent calls it will not update anything it the control hasn't moved + // Consider for example the case in which a snap indicator is drawn at (0, 0); + // If moveto() is called then it will not set _moved to true because we're initially already at (0, 0) + ctrl->_moved = true; // Is this flag ever going to be set back to false? I can't find where that is supposed to happen ctrl->box.x0 = ctrl->box.y0 = ctrl->box.x1 = ctrl->box.y1 = 0; ctrl->cache = NULL; -- cgit v1.2.3