Sorry, I am sure this is just such a stupid question. But I don't get how ui.Transform.rotate works. I put an example below. Naively, I thought that the rotation would just pivot around the center point of the rect. But it clearly does not.
Any help appreciated
import ui
class MyClass(ui.View):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def draw(self):
s = ui.Path.rect(100, 100, 200, 200)
with ui.GState():
ui.set_color('deeppink')
s.fill()
with ui.GState():
ui.concat_ctm(ui.Transform.rotation(.45))
ui.set_color('red')
s.fill()
if __name__ == '__main__':
w = 600
h = 800
f = (0, 0, w, h)
mc = MyClass(frame = f, bg_color = 'white')
mc.present('sheet')
