diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2016-10-19 11:11:05 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2016-10-19 11:11:05 +0000 |
| commit | 96bf3670efc23ecee2b9546b0b55993b1601c221 (patch) | |
| tree | 57811483e1b2ea1e395b8f125964e45296138b6c /src/display/drawing-shape.cpp | |
| parent | update author list in about dialog from AUTHORS file (diff) | |
| download | inkscape-96bf3670efc23ecee2b9546b0b55993b1601c221.tar.gz inkscape-96bf3670efc23ecee2b9546b0b55993b1601c221.zip | |
Implement 'vector-effect' value 'non-scaling-stroke'. No GUI yet.
(bzr r15177)
Diffstat (limited to 'src/display/drawing-shape.cpp')
| -rw-r--r-- | src/display/drawing-shape.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/display/drawing-shape.cpp b/src/display/drawing-shape.cpp index 63efb3c0d..ba95a63ce 100644 --- a/src/display/drawing-shape.cpp +++ b/src/display/drawing-shape.cpp @@ -180,6 +180,10 @@ DrawingShape::_renderStroke(DrawingContext &dc) if( has_stroke ) { // TODO: remove segments outside of bbox when no dashes present dc.path(_curve->get_pathvector()); + if (_style && _style->vector_effect.computed == SP_VECTOR_EFFECT_NON_SCALING_STROKE) { + dc.restore(); + dc.save(); + } _nrstyle.applyStroke(dc); dc.strokePreserve(); dc.newPath(); // clear path @@ -213,7 +217,7 @@ DrawingShape::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigne } { Inkscape::DrawingContext::Save save(dc); dc.setSource(rgba); - dc.setLineWidth(0.5); + dc.setLineWidth(5); dc.setTolerance(0.5); dc.stroke(); } @@ -230,6 +234,8 @@ DrawingShape::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigne // we assume the context has no path Inkscape::DrawingContext::Save save(dc); dc.transform(_ctm); + dc.path(_curve->get_pathvector()); + // update fill and stroke paints. // this cannot be done during nr_arena_shape_update, because we need a Cairo context @@ -237,14 +243,16 @@ DrawingShape::_renderItem(DrawingContext &dc, Geom::IntRect const &area, unsigne bool has_fill = _nrstyle.prepareFill(dc, _item_bbox, _fill_pattern); bool has_stroke = _nrstyle.prepareStroke(dc, _item_bbox, _stroke_pattern); has_stroke &= (_nrstyle.stroke_width != 0); - if (has_fill || has_stroke) { // TODO: remove segments outside of bbox when no dashes present - dc.path(_curve->get_pathvector()); if (has_fill) { _nrstyle.applyFill(dc); dc.fillPreserve(); } + if (_style && _style->vector_effect.computed == SP_VECTOR_EFFECT_NON_SCALING_STROKE) { + dc.restore(); + dc.save(); + } if (has_stroke) { _nrstyle.applyStroke(dc); dc.strokePreserve(); |
