diff options
Diffstat (limited to 'src/display/drawing-item.cpp')
| -rw-r--r-- | src/display/drawing-item.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp index f83d0eaeb..86bd0c7f9 100644 --- a/src/display/drawing-item.cpp +++ b/src/display/drawing-item.cpp @@ -555,6 +555,33 @@ DrawingItem::update(Geom::IntRect const &area, UpdateContext const &ctx, unsigne if (_transform) { child_ctx.ctm = *_transform * ctx.ctm; } + + // Vector effects + if (_style) { + + if (_style->vector_effect.fixed) { + child_ctx.ctm.setTranslation(Geom::Point(0,0)); + } + + if (_style->vector_effect.size) { + double value = sqrt(child_ctx.ctm.det()); + if (value > 0 ) { + child_ctx.ctm[0] = child_ctx.ctm[0]/value; + child_ctx.ctm[1] = child_ctx.ctm[1]/value; + child_ctx.ctm[2] = child_ctx.ctm[2]/value; + child_ctx.ctm[3] = child_ctx.ctm[3]/value; + } + } + + if (_style->vector_effect.rotate) { + double value = sqrt(child_ctx.ctm.det()); + child_ctx.ctm[0] = value; + child_ctx.ctm[1] = 0; + child_ctx.ctm[2] = 0; + child_ctx.ctm[3] = value; + } + } + /* Remember the transformation matrix */ Geom::Affine ctm_change = _ctm.inverse() * child_ctx.ctm; _ctm = child_ctx.ctm; |
