diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-02-25 05:46:48 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-02-25 05:46:48 +0000 |
| commit | 2a33ed0b021d89f29f429ae0746e42679af82155 (patch) | |
| tree | 388f55ec2cdb0b10ef26fef65f54bf49b90dda93 /src/display/sp-canvas.cpp | |
| parent | add 'hide all except selected' checkbox (diff) | |
| download | inkscape-2a33ed0b021d89f29f429ae0746e42679af82155.tar.gz inkscape-2a33ed0b021d89f29f429ae0746e42679af82155.zip | |
move a global to a class property; reduce the use of is_scrolling to prevent the lack-of-redraw issues
(bzr r2430)
Diffstat (limited to 'src/display/sp-canvas.cpp')
| -rw-r--r-- | src/display/sp-canvas.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index b10af7f6a..f716d383a 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -988,6 +988,9 @@ sp_canvas_init (SPCanvas *canvas) canvas->forced_redraw_limit = -1; canvas->slowest_buffer = 0; + + canvas->is_scrolling = false; + } /** @@ -1590,8 +1593,6 @@ sp_canvas_paint_single_buffer (SPCanvas *canvas, int x0, int y0, int x1, int y1, } } -static int is_scrolling = 0; - /* Paint the given rect, while updating canvas->redraw_aborted and running iterations after each * buffer; make sure canvas->redraw_aborted never goes past aborted_limit (used for 2-rect * optimized repaint) @@ -1707,11 +1708,11 @@ sp_canvas_paint_rect_internal (SPCanvas *canvas, NRRectL *rect, NR::ICoord *x_ab // OPTIMIZATION IDEA: if drawing is really slow (as measured by canvas->slowest // buffer), do the same - process some events even before we paint any buffers - if (is_scrolling) { - is_scrolling = 0; + if (canvas->is_scrolling) { while (Gtk::Main::events_pending()) { // process any events Gtk::Main::iteration(false); } + canvas->is_scrolling = false; if (this_count != canvas->redraw_count) { // if there was redraw, return 1; // interrupt this one } @@ -2154,7 +2155,7 @@ sp_canvas_root (SPCanvas *canvas) * Scrolls canvas to specific position. */ void -sp_canvas_scroll_to (SPCanvas *canvas, double cx, double cy, unsigned int clear) +sp_canvas_scroll_to (SPCanvas *canvas, double cx, double cy, unsigned int clear, bool is_scrolling) { g_return_if_fail (canvas != NULL); g_return_if_fail (SP_IS_CANVAS (canvas)); @@ -2174,7 +2175,7 @@ sp_canvas_scroll_to (SPCanvas *canvas, double cx, double cy, unsigned int clear) if (!clear) { // scrolling without zoom; redraw only the newly exposed areas if ((dx != 0) || (dy != 0)) { - is_scrolling = 1; + canvas->is_scrolling = is_scrolling; if (GTK_WIDGET_REALIZED (canvas)) { gdk_window_scroll (SP_CANVAS_WINDOW (canvas), -dx, -dy); } |
