From 80ef64f9cb83c0c2e1e60e663917e0d31592de82 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sat, 31 Mar 2007 17:22:06 +0000 Subject: [PATCH] make whirl use the center of view as center of whirl --- share/extensions/whirl.inx | 2 -- 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 @@ org.ekips.filter.whirl whirl.py inkex.py - 0.0 - 0.0 5.0 true 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() -- 2.30.2