UBox: Limit radius to possible values and merge flex if radii touch
This commit is contained in:
parent
0398c3ae98
commit
5e33d057fc
|
@ -75,9 +75,12 @@ class UBox(_TopEdge, _ChestLid):
|
|||
|
||||
for nr, flex in enumerate("XE"):
|
||||
self.edges["F"](y-r)
|
||||
if x-2*r > 0.1 * self.thickness:
|
||||
self.edges[flex](cl, h=th)
|
||||
self.edges["F"](x-2*r)
|
||||
self.edges[flex](cl, h=th)
|
||||
else:
|
||||
self.edges[flex](2*cl+x-2*r, h=th)
|
||||
self.edges["F"](y-r)
|
||||
self.edgeCorner("F", e[nr])
|
||||
e[nr](h)
|
||||
|
@ -88,6 +91,8 @@ class UBox(_TopEdge, _ChestLid):
|
|||
def render(self):
|
||||
x, y, h, r = self.x, self.y, self.h, self.radius
|
||||
|
||||
self.radius = r = min(r, x/2.0, y)
|
||||
|
||||
self.open()
|
||||
|
||||
t1, t2, t3, t4 = self.topEdges(self.top_edge)
|
||||
|
|
Loading…
Reference in New Issue