diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-03-31 17:22:06 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-03-31 17:22:06 +0000 |
| commit | 59d4794d0eee7bac2be428e91f517debf5b24965 (patch) | |
| tree | 1b23e516227068120ba5851f4f06cdc05ad2968d | |
| parent | add missing undo transaction for Ctrl+click (diff) | |
| download | inkscape-59d4794d0eee7bac2be428e91f517debf5b24965.tar.gz inkscape-59d4794d0eee7bac2be428e91f517debf5b24965.zip | |
make whirl use the center of view as center of whirl
(bzr r2794)
| -rw-r--r-- | share/extensions/whirl.inx | 2 | ||||
| -rw-r--r-- | share/extensions/whirl.py | 16 |
2 files changed, 4 insertions, 14 deletions
diff --git a/share/extensions/whirl.inx b/share/extensions/whirl.inx index eb1293b2b..927294b53 100644 --- a/share/extensions/whirl.inx +++ b/share/extensions/whirl.inx @@ -3,8 +3,6 @@ <id>org.ekips.filter.whirl</id> <dependency type="executable" location="extensions">whirl.py</dependency> <dependency type="executable" location="extensions">inkex.py</dependency> - <param name="centerx" type="float" min="0.0" max="10000.0" _gui-text="Center X">0.0</param> - <param name="centery" type="float" min="0.0" max="10000.0" _gui-text="Center Y">0.0</param> <param name="whirl" type="float" min="0.00" max="1000.00" _gui-text="Amount of whirl">5.0</param> <param name="rotation" type="boolean" _gui-text="Rotation is clockwise">true</param> <effect> diff --git a/share/extensions/whirl.py b/share/extensions/whirl.py index b20141917..3e9df6c16 100644 --- a/share/extensions/whirl.py +++ b/share/extensions/whirl.py @@ -21,14 +21,6 @@ import math, inkex, cubicsuperpath class Whirl(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) - self.OptionParser.add_option("-x", "--centerx", - action="store", type="float", - dest="centerx", default=10.0, - help="") - self.OptionParser.add_option("-y", "--centery", - action="store", type="float", - dest="centery", default=0.0, - help="") self.OptionParser.add_option("-t", "--whirl", action="store", type="float", dest="whirl", default=1.0, @@ -49,16 +41,16 @@ class Whirl(inkex.Effect): for sub in p: for csp in sub: for point in csp: - point[0] -= self.options.centerx - point[1] -= self.options.centery + point[0] -= self.view_center[0] + point[1] -= self.view_center[1] dist = math.sqrt((point[0] ** 2) + (point[1] ** 2)) if dist != 0: a = rotation * dist * whirl theta = math.atan2(point[1], point[0]) + a point[0] = (dist * math.cos(theta)) point[1] = (dist * math.sin(theta)) - point[0] += self.options.centerx - point[1] += self.options.centery + point[0] += self.view_center[0] + point[1] += self.view_center[1] d.value = cubicsuperpath.formatPath(p) e = Whirl() |
