From 1186e3c70437921ccb2aeba04edb235118e984f9 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Wed, 16 Sep 2020 20:16:45 +0200 Subject: [PATCH 1/2] ppp --- src/ui/widget/canvas.cpp | 43 ++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/ui/widget/canvas.cpp b/src/ui/widget/canvas.cpp index ead5640484..eea1a47920 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", 1000); // 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; + } } } } -- GitLab From d36f51e06728469c34f6e21cbfe3a514fc5fe979 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Wed, 16 Sep 2020 20:49:46 +0000 Subject: [PATCH 2/2] tiny change to limit --- src/ui/widget/canvas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/widget/canvas.cpp b/src/ui/widget/canvas.cpp index eea1a47920..f3dc7f3529 100644 --- a/src/ui/widget/canvas.cpp +++ b/src/ui/widget/canvas.cpp @@ -324,7 +324,7 @@ Canvas::scroll_to(Geom::Point const &c, bool clear) } 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", 1000); + 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); -- GitLab