-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy path_line.py
More file actions
28 lines (22 loc) · 779 Bytes
/
_line.py
File metadata and controls
28 lines (22 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from ._base import (
GraphicFeature,
GraphicFeatureEvent,
block_reentrance,
)
class Thickness(GraphicFeature):
event_info_spec = [
{"dict key": "value", "type": "float", "description": "new thickness value"},
]
def __init__(self, value: float, property_name: str = "thickness"):
self._value = value
super().__init__(property_name=property_name)
@property
def value(self) -> float:
return self._value
@block_reentrance
def set_value(self, graphic, value: float):
value = float(value)
graphic.world_object.material.thickness = value
self._value = value
event = GraphicFeatureEvent(type=self._property_name, info={"value": value})
self._call_event_handlers(event)