Flexbox2: Limit radius to sane values
This commit is contained in:
parent
2043ee6d8a
commit
f65bafbcac
|
@ -67,9 +67,11 @@ class FlexBox(Boxes):
|
|||
self.corner(90)
|
||||
|
||||
def render(self):
|
||||
self.radius = self.radius or min(x, y)/2.0
|
||||
self.c4 = c4 = math.pi * self.radius * 0.5
|
||||
self.latchsize = 8*self.thickness
|
||||
self.radius = self.radius or min(self.x/2.0, self.y-self.latchsize)
|
||||
self.radius = min(self.radius, self.x/2.0)
|
||||
self.radius = min(self.radius, max(0, self.y-self.latchsize))
|
||||
self.c4 = c4 = math.pi * self.radius * 0.5
|
||||
|
||||
self.open()
|
||||
|
||||
|
|
Loading…
Reference in New Issue