From 19225039b8667679c175e62f1faa29495b4ed547 Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Fri, 26 Apr 2019 00:30:04 +1000 Subject: Add out of bound checks to fill bucket Fixes https://gitlab.com/inkscape/inbox/issues/398 --- src/ui/tools/flood-tool.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ui/tools') diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp index 6db530917..68987dfcc 100644 --- a/src/ui/tools/flood-tool.cpp +++ b/src/ui/tools/flood-tool.cpp @@ -627,7 +627,7 @@ static ScanlineCheckResult perform_bitmap_scanline_check(std::deque bool can_paint_top = (top_ty > 0); bool can_paint_bottom = (bottom_ty < bci.height); - Geom::Point t = fill_queue->front(); + Geom::Point front_of_queue = fill_queue->empty() ? Geom::Point() : fill_queue->front(); do { ok = false; @@ -645,8 +645,11 @@ static ScanlineCheckResult perform_bitmap_scanline_check(std::deque paint_directions = paint_pixel(px, trace_px, orig_color, bci, current_trace_t); if (bci.radius == 0) { mark_pixel_checked(current_trace_t); - if ((t[Geom::X] == bci.x) && (t[Geom::Y] == bci.y)) { - fill_queue->pop_front(); t = fill_queue->front(); + if ((!fill_queue->empty()) && + (front_of_queue[Geom::X] == bci.x) && + (front_of_queue[Geom::Y] == bci.y)) { + fill_queue->pop_front(); + front_of_queue = fill_queue->empty() ? Geom::Point() : fill_queue->front(); } } -- cgit v1.2.3 From 9db06f0ff1f297754e328eb5909e98792091b6ec Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Fri, 26 Apr 2019 14:10:54 +1000 Subject: Make display unit change roll out to toolbars Add exception for measure tool, which uses preferences Fixes https://gitlab.com/inkscape/inbox/issues/393 Partial fix: https://gitlab.com/inkscape/inkscape/issues/208 --- src/ui/tools/measure-tool.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ui/tools') diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index f8c8517c9..64824514e 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -810,7 +810,7 @@ void MeasureTool::toMarkDimension() setLine(start, end, true, color); Glib::ustring unit_name = prefs->getString("/tools/measure/unit"); if (!unit_name.compare("")) { - unit_name = "px"; + unit_name = DEFAULT_UNIT_NAME; } double fontsize = prefs->getDouble("/tools/measure/fontsize", 10.0); int precision = prefs->getInt("/tools/measure/precision", 2); @@ -1162,7 +1162,7 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups) Glib::ustring unit_name = prefs->getString("/tools/measure/unit"); bool only_selected = prefs->getBool("/tools/measure/only_selected", false); if (!unit_name.compare("")) { - unit_name = "px"; + unit_name = DEFAULT_UNIT_NAME; } Geom::Scale zoom = Geom::Scale(Inkscape::Util::Quantity::convert(desktop->current_zoom(), "px", unit->abbr)).inverse(); if(newover != over){ @@ -1324,7 +1324,7 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom, } Glib::ustring unit_name = prefs->getString("/tools/measure/unit"); if (!unit_name.compare("")) { - unit_name = "px"; + unit_name = DEFAULT_UNIT_NAME; } double scale = prefs->getDouble("/tools/measure/scale", 100.0) / 100.0; double fontsize = prefs->getDouble("/tools/measure/fontsize", 10.0); -- cgit v1.2.3