Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def diag45(pict,x,y,c):
- #@param pict: Picture
- #@param x: int
- #@param y: int
- #@param c: color
- w,h = getWidth(pict)-1, getHeight(pict)-1
- if x<0 or x>=w or y<0 or y>=h:
- return
- else:
- diffx = w-x
- diffy = h-y
- x1 = w
- y1 = h
- if diffy>diffx:
- y1 -= (diffy-diffx)
- elif diffx>diffy:
- x1 -= (diffx-diffy)
- else:
- pass
- addLine(pict,x,y,x1,y1,c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement