diff options
| -rw-r--r-- | share/ui/menus.xml | 2 | ||||
| -rw-r--r-- | src/desktop.cpp | 4 | ||||
| -rw-r--r-- | src/desktop.h | 4 | ||||
| -rw-r--r-- | src/display/drawing-shape.cpp | 28 | ||||
| -rw-r--r-- | src/display/drawing-text.cpp | 13 | ||||
| -rw-r--r-- | src/display/drawing.cpp | 6 | ||||
| -rw-r--r-- | src/display/drawing.h | 2 | ||||
| -rw-r--r-- | src/display/rendermode.h | 2 | ||||
| -rw-r--r-- | src/ui/interface.cpp | 4 | ||||
| -rw-r--r-- | src/verbs.cpp | 8 | ||||
| -rw-r--r-- | src/verbs.h | 2 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 4 |
12 files changed, 40 insertions, 39 deletions
diff --git a/share/ui/menus.xml b/share/ui/menus.xml index 818e7a968..03cd74d74 100644 --- a/share/ui/menus.xml +++ b/share/ui/menus.xml @@ -108,7 +108,7 @@ <verb verb-id="ViewModeNormal" radio="yes" default="yes"/> <verb verb-id="ViewModeNoFilters" radio="yes"/> <verb verb-id="ViewModeOutline" radio="yes"/> - <verb verb-id="ViewModeOutlineThin" radio="yes"/> + <verb verb-id="ViewModeVisibleHairlines" radio="yes"/> <!--Better location in menu needs to be found--> <!--verb verb-id="ViewModePrintColorsPreview" radio="yes"/--> <!--verb verb-id="DialogPrintColorsPreview" /--> diff --git a/src/desktop.cpp b/src/desktop.cpp index c1891301c..335afa17d 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -519,9 +519,9 @@ void SPDesktop::displayModeToggle() { _setDisplayMode(Inkscape::RENDERMODE_OUTLINE); break; case Inkscape::RENDERMODE_OUTLINE: - _setDisplayMode(Inkscape::RENDERMODE_OUTLINE_THIN); + _setDisplayMode(Inkscape::RENDERMODE_VISIBLE_HAIRLINES); break; - case Inkscape::RENDERMODE_OUTLINE_THIN: + case Inkscape::RENDERMODE_VISIBLE_HAIRLINES: _setDisplayMode(Inkscape::RENDERMODE_NORMAL); break; default: diff --git a/src/desktop.h b/src/desktop.h index a38876de1..ec6ea99f7 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -266,8 +266,8 @@ public: void setDisplayModeOutline() { _setDisplayMode(Inkscape::RENDERMODE_OUTLINE); } - void setDisplayModeOutlineThin() { - _setDisplayMode(Inkscape::RENDERMODE_OUTLINE_THIN); + void setDisplayModeVisibleHairlines() { + _setDisplayMode(Inkscape::RENDERMODE_VISIBLE_HAIRLINES); } void displayModeToggle(); Inkscape::RenderMode _display_mode; diff --git a/src/display/drawing-shape.cpp b/src/display/drawing-shape.cpp index c2208d161..05123297e 100644 --- a/src/display/drawing-shape.cpp +++ b/src/display/drawing-shape.cpp @@ -186,13 +186,13 @@ DrawingShape::_renderStroke(DrawingContext &dc) } _nrstyle.applyStroke(dc); - // Special handling for thin outline mode when we're drawing lines smaller than half a - // pixel - if (_drawing.outlineThin()) { - double outline_thin_size = 0.5, trash = 0.5; - dc.device_to_user_distance(outline_thin_size, trash); - if (_nrstyle.stroke_width < outline_thin_size) { - dc.setLineWidth(outline_thin_size); + // If the draw mode is set to visible hairlines, don't let them get smaller than half a + // pixel. + if (_drawing.visibleHairlines()) { + double half_pixel_size = 0.5, trash = 0.5; + dc.device_to_user_distance(half_pixel_size, trash); + if (_nrstyle.stroke_width < half_pixel_size) { + dc.setLineWidth(half_pixel_size); } } @@ -267,13 +267,13 @@ DrawingShape::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigne if (has_stroke) { _nrstyle.applyStroke(dc); - // Special handling for thin outline mode when we're drawing lines smaller than - // half a pixel - if (_drawing.outlineThin()) { - double outline_thin_size = 0.5, trash = 0.5; - dc.device_to_user_distance(outline_thin_size, trash); - if (_nrstyle.stroke_width < outline_thin_size) { - dc.setLineWidth(outline_thin_size); + // If the draw mode is set to visible hairlines, don't let anything get smaller + // than half a pixel. + if (_drawing.visibleHairlines()) { + double half_pixel_size = 0.5, trash = 0.5; + dc.device_to_user_distance(half_pixel_size, trash); + if (_nrstyle.stroke_width < half_pixel_size) { + dc.setLineWidth(half_pixel_size); } } diff --git a/src/display/drawing-text.cpp b/src/display/drawing-text.cpp index b48ce7d31..d823012e3 100644 --- a/src/display/drawing-text.cpp +++ b/src/display/drawing-text.cpp @@ -604,12 +604,13 @@ unsigned DrawingText::_renderItem(DrawingContext &dc, Geom::IntRect const &/*are if (has_stroke) { _nrstyle.applyStroke(dc); - // Special handling for thin outline mode when we're drawing lines smaller than half a pixel - if (_drawing.outlineThin()) { - double outline_thin_size = 0.5, trash = 0.5; - dc.device_to_user_distance(outline_thin_size, trash); - if (_nrstyle.stroke_width < outline_thin_size) { - dc.setLineWidth(outline_thin_size); + // If the draw mode is set to visible hairlines, don't let anything get smaller + // than half a pixel. + if (_drawing.visibleHairlines()) { + double half_pixel_size = 0.5, trash = 0.5; + dc.device_to_user_distance(half_pixel_size, trash); + if (_nrstyle.stroke_width < half_pixel_size) { + dc.setLineWidth(half_pixel_size); } } diff --git a/src/display/drawing.cpp b/src/display/drawing.cpp index 7ecaea987..4b2a2cadf 100644 --- a/src/display/drawing.cpp +++ b/src/display/drawing.cpp @@ -79,14 +79,14 @@ Drawing::outline() const return renderMode() == RENDERMODE_OUTLINE; } bool -Drawing::outlineThin() const +Drawing::visibleHairlines() const { - return renderMode() == RENDERMODE_OUTLINE_THIN; + return renderMode() == RENDERMODE_VISIBLE_HAIRLINES; } bool Drawing::renderFilters() const { - return renderMode() == RENDERMODE_NORMAL || renderMode() == RENDERMODE_OUTLINE_THIN; + return renderMode() == RENDERMODE_NORMAL || renderMode() == RENDERMODE_VISIBLE_HAIRLINES; } int Drawing::blurQuality() const diff --git a/src/display/drawing.h b/src/display/drawing.h index 1669cc3a4..931fe8e46 100644 --- a/src/display/drawing.h +++ b/src/display/drawing.h @@ -50,7 +50,7 @@ public: RenderMode renderMode() const; ColorMode colorMode() const; bool outline() const; - bool outlineThin() const; + bool visibleHairlines() const; bool renderFilters() const; int blurQuality() const; int filterQuality() const; diff --git a/src/display/rendermode.h b/src/display/rendermode.h index 36dd0ead3..80e6da2dd 100644 --- a/src/display/rendermode.h +++ b/src/display/rendermode.h @@ -13,7 +13,7 @@ enum RenderMode { RENDERMODE_NORMAL, RENDERMODE_NO_FILTERS, RENDERMODE_OUTLINE, - RENDERMODE_OUTLINE_THIN + RENDERMODE_VISIBLE_HAIRLINES }; enum ColorMode { diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 1f04f3a49..f644aa174 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -682,8 +682,8 @@ static gboolean update_view_menu(GtkWidget *widget, cairo_t * /*cr*/, gpointer u new_state = mode == Inkscape::RENDERMODE_NO_FILTERS; } else if (!strcmp(action->id, "ViewModeOutline")) { new_state = mode == Inkscape::RENDERMODE_OUTLINE; - } else if (!strcmp(action->id, "ViewModeOutlineThin")) { - new_state = mode == Inkscape::RENDERMODE_OUTLINE_THIN; + } else if (!strcmp(action->id, "ViewModeVisibleHairlines")) { + new_state = mode == Inkscape::RENDERMODE_VISIBLE_HAIRLINES; } else if (!strcmp(action->id, "ViewColorModeNormal")) { new_state = colormode == Inkscape::COLORMODE_NORMAL; } else if (!strcmp(action->id, "ViewColorModeGrayscale")) { diff --git a/src/verbs.cpp b/src/verbs.cpp index 2c7cfb25f..fe617148a 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2132,8 +2132,8 @@ void ZoomVerb::perform(SPAction *action, void *data) case SP_VERB_VIEW_MODE_OUTLINE: dt->setDisplayModeOutline(); break; - case SP_VERB_VIEW_MODE_OUTLINE_THIN: - dt->setDisplayModeOutlineThin(); + case SP_VERB_VIEW_MODE_VISIBLE_HAIRLINES: + dt->setDisplayModeVisibleHairlines(); break; case SP_VERB_VIEW_MODE_TOGGLE: dt->displayModeToggle(); @@ -3111,8 +3111,8 @@ Verb *Verb::_base_verbs[] = { N_("Switch to normal display without filters"), nullptr), new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE, "ViewModeOutline", N_("_Outline"), N_("Switch to outline (wireframe) display mode"), nullptr), - new ZoomVerb(SP_VERB_VIEW_MODE_OUTLINE_THIN, "ViewModeOutlineThin", N_("O_utline thin strokes"), - N_("Outline strokes that are smaller than 1 pixel and draw the rest normally"), nullptr), + new ZoomVerb(SP_VERB_VIEW_MODE_VISIBLE_HAIRLINES, "ViewModeVisibleHairlines", N_("Visible _Hairlines"), + N_("Make sure hairlines are always drawn thick enough to see"), nullptr), new ZoomVerb(SP_VERB_VIEW_MODE_TOGGLE, "ViewModeToggle", N_("_Toggle"), N_("Toggle between normal and outline display modes"), nullptr), new ZoomVerb(SP_VERB_VIEW_COLOR_MODE_NORMAL, "ViewColorModeNormal", N_("_Normal"), diff --git a/src/verbs.h b/src/verbs.h index b9402ed10..fec42cca2 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -297,7 +297,7 @@ enum { SP_VERB_VIEW_MODE_NORMAL, SP_VERB_VIEW_MODE_NO_FILTERS, SP_VERB_VIEW_MODE_OUTLINE, - SP_VERB_VIEW_MODE_OUTLINE_THIN, + SP_VERB_VIEW_MODE_VISIBLE_HAIRLINES, SP_VERB_VIEW_MODE_TOGGLE, SP_VERB_VIEW_COLOR_MODE_NORMAL, SP_VERB_VIEW_COLOR_MODE_GRAYSCALE, diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 65b427208..1b717f351 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -813,8 +813,8 @@ SPDesktopWidget::updateTitle(gchar const* uri) Name += N_("outline"); } else if (desktop->getMode() == Inkscape::RENDERMODE_NO_FILTERS) { Name += N_("no filters"); - } else if (desktop->getMode() == Inkscape::RENDERMODE_OUTLINE_THIN) { - Name += N_("outline thin"); + } else if (desktop->getMode() == Inkscape::RENDERMODE_VISIBLE_HAIRLINES) { + Name += N_("visible hairlines"); } if (desktop->getColorMode() != Inkscape::COLORMODE_NORMAL && |
