@@ -56,10 +56,10 @@ class Section:
56
56
57
57
def __init__ (
58
58
self ,
59
- left : int ,
60
- bottom : int ,
61
- width : int ,
62
- height : int ,
59
+ left : int | float ,
60
+ bottom : int | float ,
61
+ width : int | float ,
62
+ height : int | float ,
63
63
* ,
64
64
name : str | None = None ,
65
65
accept_keyboard_keys : bool | Iterable = True ,
@@ -116,19 +116,19 @@ def __init__(
116
116
# section position into the current viewport
117
117
# if screen is resized it's upto the user to move or resize each section
118
118
# (section will receive on_resize event)
119
- self ._left : int = left
120
- self ._bottom : int = bottom
121
- self ._width : int = width
122
- self ._height : int = height
123
- self ._right : int = left + width
124
- self ._top : int = bottom + height
119
+ self ._left : int | float = left
120
+ self ._bottom : int | float = bottom
121
+ self ._width : int | float = width
122
+ self ._height : int | float = height
123
+ self ._right : int | float = left + width
124
+ self ._top : int | float = bottom + height
125
125
126
126
# section event capture dimensions
127
127
# if section is modal, capture all events on the screen
128
- self ._ec_left : int = 0 if self ._modal else self ._left
129
- self ._ec_right : int = self .window .width if self ._modal else self ._right
130
- self ._ec_bottom : int = 0 if self ._modal else self ._bottom
131
- self ._ec_top : int = self .window .height if self ._modal else self ._top
128
+ self ._ec_left : int | float = 0 if self ._modal else self ._left
129
+ self ._ec_right : int | float = self .window .width if self ._modal else self ._right
130
+ self ._ec_bottom : int | float = 0 if self ._modal else self ._bottom
131
+ self ._ec_top : int | float = self .window .height if self ._modal else self ._top
132
132
133
133
self .camera : Projector | None = None
134
134
"""optional section camera"""
@@ -180,7 +180,7 @@ def draw_order(self) -> int:
180
180
return self ._draw_order
181
181
182
182
@property
183
- def left (self ) -> int :
183
+ def left (self ) -> int | float :
184
184
"""Left edge of this section"""
185
185
return self ._left
186
186
@@ -192,7 +192,7 @@ def left(self, value: int):
192
192
self ._ec_right = self .window .width if self ._modal else self ._right
193
193
194
194
@property
195
- def bottom (self ) -> int :
195
+ def bottom (self ) -> int | float :
196
196
"""The bottom edge of this section"""
197
197
return self ._bottom
198
198
@@ -204,7 +204,7 @@ def bottom(self, value: int):
204
204
self ._ec_top = self .window .height if self ._modal else self ._top
205
205
206
206
@property
207
- def width (self ) -> int :
207
+ def width (self ) -> int | float :
208
208
"""The width of this section"""
209
209
return self ._width
210
210
@@ -215,7 +215,7 @@ def width(self, value: int):
215
215
self ._ec_right = self .window .width if self ._modal else self ._right
216
216
217
217
@property
218
- def height (self ) -> int :
218
+ def height (self ) -> int | float :
219
219
"""The height of this section"""
220
220
return self ._height
221
221
@@ -226,7 +226,7 @@ def height(self, value: int):
226
226
self ._ec_top = self .window .height if self ._modal else self ._top
227
227
228
228
@property
229
- def right (self ) -> int :
229
+ def right (self ) -> int | float :
230
230
"""Right edge of this section"""
231
231
return self ._right
232
232
@@ -238,7 +238,7 @@ def right(self, value: int):
238
238
self ._ec_left = 0 if self ._modal else self ._left
239
239
240
240
@property
241
- def top (self ) -> int :
241
+ def top (self ) -> int | float :
242
242
"""Top edge of this section"""
243
243
return self ._top
244
244
0 commit comments