quick cut of xt/yt, needs to handle styles

This commit is contained in:
Adam Mayer 2018-01-02 21:58:43 -05:00
parent cda0694f04
commit 0e13833b85

View File

@ -168,6 +168,42 @@ class CairoPlotter:
p=self.context.get_current_point()
self.context.arc(p[0],p[1],r,0.0,math.pi*2)
def yt(self, params):
l=coordlist(params,5)
left = l[3]
right = l[4]
num = int(l[2])
if l[0]:
dist = l[1]
tw = dist/num
else:
dist = l[1]*num
tw = l[1]
(x,y) = self.context.get_current_point()
self.context.line_to(x,y+dist)
for i in range(num):
y1 = y + tw*(i+1)
self.context.move_to(x+left,y1)
self.context.line_to(x-right,y1)
def xt(self, params):
l=coordlist(params,5)
above = l[3]
below = l[4]
num = int(l[2])
if l[0]:
dist = l[1]
tw = dist/num
else:
dist = l[1]*num
tw = l[1]
(x,y) = self.context.get_current_point()
self.context.line_to(x+dist,y)
for i in range(num):
x1 = x + tw*(i+1)
self.context.move_to(x1,y+above)
self.context.line_to(x1,y-below)
def ac(self,params):
l=coordlist(params)
r=l[0]