diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2008-01-30 20:05:58 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2008-01-30 20:05:58 +0000 |
| commit | 1f73043224256571ebbbbad8b7e8be4bbc09f9ed (patch) | |
| tree | 8ae1c33244f10de4166ac6d708b18920b929164d /src/display | |
| parent | A bunch of i18n-related issues fixed, ru.po slightly updated. Please do not f... (diff) | |
| download | inkscape-1f73043224256571ebbbbad8b7e8be4bbc09f9ed.tar.gz inkscape-1f73043224256571ebbbbad8b7e8be4bbc09f9ed.zip | |
2nd part of the fix for bug #167500: correctly update the rulers when they change size
(bzr r4621)
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/sp-canvas.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 2033f8a69..cce43825a 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -1199,7 +1199,7 @@ sp_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation) } widget->allocation = *allocation; - + if (GTK_WIDGET_REALIZED (widget)) { gdk_window_move_resize (widget->window, widget->allocation.x, widget->allocation.y, @@ -2084,7 +2084,7 @@ sp_canvas_root (SPCanvas *canvas) } /** - * Scrolls canvas to specific position. + * Scrolls canvas to specific position (cx and cy are measured in screen pixels) */ void sp_canvas_scroll_to (SPCanvas *canvas, double cx, double cy, unsigned int clear, bool is_scrolling) @@ -2092,12 +2092,12 @@ sp_canvas_scroll_to (SPCanvas *canvas, double cx, double cy, unsigned int clear, g_return_if_fail (canvas != NULL); g_return_if_fail (SP_IS_CANVAS (canvas)); - int ix = (int) round(cx); //cx might be negative, so (int)(cx + 0.5) will not do! - int iy = (int) round(cy); - int dx = ix - canvas->x0; - int dy = iy - canvas->y0; + int ix = (int) round(cx); // ix and iy are the new canvas coordinates (integer screen pixels) + int iy = (int) round(cy); // cx might be negative, so (int)(cx + 0.5) will not do! + int dx = ix - canvas->x0; // dx and dy specify the displacement (scroll) of the + int dy = iy - canvas->y0; // canvas w.r.t its previous position - canvas->dx0 = cx; + canvas->dx0 = cx; // here the 'd' stands for double, not delta! canvas->dy0 = cy; canvas->x0 = ix; canvas->y0 = iy; |
