|
1 | 1 |
|
2 | 2 | import math
|
3 |
| -from nicegui import ui |
| 3 | +from nicegui import ui, app |
4 | 4 | from svg import SVG
|
5 | 5 | from Shapes.AlphaMask.alphamask import AlphaMask
|
6 | 6 | from Shapes.Circle.circle import Circle
|
|
13 | 13 | from Shapes.Clip.clip import Clip
|
14 | 14 | from Shapes.Group.group import Group
|
15 | 15 |
|
16 |
| -svg= SVG().style("border: 1px solid black;") |
17 | 16 |
|
18 |
| -with svg: |
19 |
| - group = Group() |
20 |
| - with group: |
21 |
| - Circle(50, 50, 20, fill="red") |
22 |
| - Rectangle(100, 100, 50, 50, fill="green") |
23 |
| - Line(150, 150, 200, 200, stroke="blue", stroke_width=5) |
24 |
| - NGon(250, 250, 5, 50, fill="yellow") |
25 |
| - # group.move_group(20, 0) |
26 |
| - Rectangle(0, 0, 20, 20, fill="black").on("svg:pointerdown", lambda: group.move_group(20, 0)) |
27 | 17 |
|
| 18 | +def main(): |
| 19 | + svg= SVG().style("border: 1px solid black;") |
28 | 20 |
|
29 |
| -ui.run() |
| 21 | + |
| 22 | + with svg: |
| 23 | + group = Group() |
| 24 | + with group: |
| 25 | + Circle(50, 50, 20, fill="red") |
| 26 | + Rectangle(100, 100, 50, 50, fill="green") |
| 27 | + Line(150, 150, 200, 200, stroke="blue", stroke_width=5) |
| 28 | + NGon(250, 250, 5, 50, fill="yellow") |
| 29 | + Rectangle(0, 0, 20, 20, fill="black").on("svg:pointerdown", lambda: group.move_group(20, 0)) |
| 30 | + |
| 31 | + |
| 32 | +main() |
| 33 | +ui.run(on_air=True) |
0 commit comments