@omz, it seems a shame ui.path objects can't contain more attrs than they do. Like stroke and fill colors for example. They are normally short lived objects so should not be a memory issue. But it makes it a little harder to make generic func/methods. Maybe I am missing something. But the below method is flawed even its been called in a Ui.GState() context. Same as ui.shadow, I think would be nice if could be connected to the ui.Path.
I guess it's this way because of the Objective C, iOS frame work. I still mention it, in case I am missing something so simple.
The below is flawed without a lot of extra Params.
def draw_shape(self, shape = 'rect', r = None,
stroke = False, fill = False):
if not r:
r = self.bounds
if shape is 'rect':
s = ui.Path.rect(*r)
elif shape is 'oval':
s = ui.Path.rect(*r)
else:
s = ui.Path.rounded_rect(*r, * self.corner_radius)
if stroke:
s.stroke()
if fill:
s.fill()