diff --git a/src/ui/widget/canvas.cpp b/src/ui/widget/canvas.cpp index ead5640484ddb56b7b49eac8f5614dd2bc29e15e..f3dc7f35299551214924da59d1328dd920f2c2e9 100644 --- a/src/ui/widget/canvas.cpp +++ b/src/ui/widget/canvas.cpp @@ -322,7 +322,9 @@ Canvas::scroll_to(Geom::Point const &c, bool clear) if (dx == 0 && dy == 0) { return; // No scroll... do nothing. } - + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + guint redrawPriority = prefs->getIntLimited("/options/redrawpriority/value", G_PRIORITY_HIGH_IDLE, G_PRIORITY_HIGH_IDLE, G_PRIORITY_DEFAULT_IDLE); + prefs->setInt("/options/redrawpriority/value", 300); // See if there is any overlap between canvas before and after scrolling. Geom::IntRect old_area = Geom::IntRect::from_xywh(old_x0, old_y0, _allocation.get_width(), _allocation.get_height()); Geom::IntRect new_area = old_area + Geom::IntPoint(dx, dy); @@ -337,6 +339,7 @@ Canvas::scroll_to(Geom::Point const &c, bool clear) if (clear || !overlap) { redraw_all(); + prefs->setInt("/options/redrawpriority/value", redrawPriority); return; // Check if this is OK } @@ -360,6 +363,7 @@ Canvas::scroll_to(Geom::Point const &c, bool clear) if (grid) { grid->UpdateRulers(); } + prefs->setInt("/options/redrawpriority/value", redrawPriority); } /** @@ -1157,14 +1161,23 @@ Canvas::paint_rect_internal(PaintRectSetup const *setup, Geom::IntRect const &th lo = Geom::IntRect(this_rect.left(), this_rect.top(), mid, this_rect.bottom()); hi = Geom::IntRect(mid, this_rect.top(), this_rect.right(), this_rect.bottom()); - + // Always paint towards the mouse first if (setup->mouse_loc[Geom::X] < mid) { - // Always paint towards the mouse first - return paint_rect_internal(setup, lo) - && paint_rect_internal(setup, hi); + // rendering always return true but if previously return false no need to other zones in the same level + // check because it return false probably + bool one = paint_rect_internal(setup, lo); + if (one) { + return paint_rect_internal(setup, hi); + } else { + return false; + } } else { - return paint_rect_internal(setup, hi) - && paint_rect_internal(setup, lo); + bool one = paint_rect_internal(setup, hi); + if (one) { + return paint_rect_internal(setup, lo); + } else { + return false; + } } } else { int mid = this_rect[Geom::Y].middle(); @@ -1174,11 +1187,19 @@ Canvas::paint_rect_internal(PaintRectSetup const *setup, Geom::IntRect const &th if (setup->mouse_loc[Geom::Y] < mid) { // Always paint towards the mouse first - return paint_rect_internal(setup, lo) - && paint_rect_internal(setup, hi); + bool one = paint_rect_internal(setup, lo); + if (one) { + return paint_rect_internal(setup, hi); + } else { + return false; + } } else { - return paint_rect_internal(setup, hi) - && paint_rect_internal(setup, lo); + bool one = paint_rect_internal(setup, hi); + if (one) { + return paint_rect_internal(setup, lo); + } else { + return false; + } } } }