diff options
| author | Rick Yorgason <rick@firefang.com> | 2018-10-18 03:06:34 +0000 |
|---|---|---|
| committer | Rick Yorgason <rick@firefang.com> | 2018-10-18 03:06:34 +0000 |
| commit | 33131a183f9f34d798a741f317a91d87537684f6 (patch) | |
| tree | 5753465248676eb17c48029e676e99ed69ad37e8 /src/display/drawing-shape.cpp | |
| parent | Code cleanup and adding comments. (diff) | |
| download | inkscape-33131a183f9f34d798a741f317a91d87537684f6.tar.gz inkscape-33131a183f9f34d798a741f317a91d87537684f6.zip | |
New "Outline thin strokes" view mode which draws thin strokes in outline mode so they're easier to see, while still drawing everything else normally. Very useful for making hairline strokes (0.001") for laser cutters.
Diffstat (limited to 'src/display/drawing-shape.cpp')
| -rw-r--r-- | src/display/drawing-shape.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/display/drawing-shape.cpp b/src/display/drawing-shape.cpp index 63db9475d..c2208d161 100644 --- a/src/display/drawing-shape.cpp +++ b/src/display/drawing-shape.cpp @@ -185,6 +185,17 @@ DrawingShape::_renderStroke(DrawingContext &dc) dc.save(); } _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); + } + } + dc.strokePreserve(); dc.newPath(); // clear path } @@ -255,6 +266,17 @@ 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); + } + } + dc.strokePreserve(); } dc.newPath(); // clear path |
