创建 mxGeometry 元素
(
x: float = 0,
y: float = 0,
width: float = 0,
height: float = 0,
relative: bool = False,
as_type: str = "geometry",
)
| 27 | |
| 28 | |
| 29 | def create_geometry( |
| 30 | x: float = 0, |
| 31 | y: float = 0, |
| 32 | width: float = 0, |
| 33 | height: float = 0, |
| 34 | relative: bool = False, |
| 35 | as_type: str = "geometry", |
| 36 | ) -> ET.Element: |
| 37 | """创建 mxGeometry 元素""" |
| 38 | g = ET.Element("mxGeometry", {"as": as_type, "x": str(x), "y": str(y), "width": str(width), "height": str(height)}) |
| 39 | if relative: |
| 40 | g.set("relative", "1") |
| 41 | return g |
| 42 | |
| 43 | |
| 44 | def prettify_xml(elem: ET.Element) -> str: |
nothing calls this directly
no outgoing calls
no test coverage detected