diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-03-28 13:57:06 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-03-28 13:57:06 +0000 |
| commit | b21958f914e82435e935bb732b64cdf3f685c3f1 (patch) | |
| tree | 3ec7a8c51b52c90f57ac705f1fa7f7b539a2adc5 /src | |
| parent | update to trunk (diff) | |
| download | inkscape-b21958f914e82435e935bb732b64cdf3f685c3f1.tar.gz inkscape-b21958f914e82435e935bb732b64cdf3f685c3f1.zip | |
adding rotation transform
(bzr r13708.1.20)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-copy_rotate.cpp | 18 | ||||
| -rw-r--r-- | src/live_effects/lpe-copy_rotate.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index 63d6b8bfa..5474bfb70 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -89,6 +89,24 @@ LPECopyRotate::doOnApply(SPLPEItem const* lpeitem) dir = unit_vector(B - A); } +void +LPECopyRotate::transform_multiply(Geom::Affine const& postmul, bool set) +{ + if(postmul->isRotation()){ + Geom::Point rot = (Geom::Rotate)postmul::vector(); + coord angle = rad_to_deg(atan2(rot)); + starting_angle.param_setValue(starting_angle + angle); + starting_angle.param_update_default(starting_angle + angle); + rotation_angle.param_setValue(rotation_angle + angle); + rotation_angle.param_update_default(rotation_angle + angle); + } + // cycle through all parameters. Most parameters will not need transformation, but path and point params do. + + for (std::vector<Parameter *>::iterator it = param_vector.begin(); it != param_vector.end(); ++it) { + Parameter * param = *it; + param->param_transform_multiply(postmul, set); + } +} void LPECopyRotate::doBeforeEffect (SPLPEItem const* lpeitem) diff --git a/src/live_effects/lpe-copy_rotate.h b/src/live_effects/lpe-copy_rotate.h index bdbc61d07..d0a5b004b 100644 --- a/src/live_effects/lpe-copy_rotate.h +++ b/src/live_effects/lpe-copy_rotate.h @@ -48,6 +48,8 @@ public: virtual void resetDefaults(SPItem const* item); + virtual void transform_multiply(Geom::Affine const& postmul, bool set); + /* the knotholder entity classes must be declared friends */ friend class CR::KnotHolderEntityStartingAngle; friend class CR::KnotHolderEntityRotationAngle; |
