Skip to content

Commit 84e8789

Browse files
authored
Small cleanup (#2460)
1 parent 9d13188 commit 84e8789

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

arcade/camera/camera_2d.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ def projection(self) -> Rect:
569569

570570
@projection.setter
571571
def projection(self, value: Rect) -> None:
572-
573572
# Unpack and validate
574573
if not value:
575574
raise ZeroProjectionDimension((f"Projection area is 0, {value.lrbt}"))

arcade/future/splash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ArcadeSplash(View):
2121
dark_mode: If True, the splash screen will be shown in dark mode. (Default False)
2222
"""
2323

24-
def __init__(self, view: View, duration: int = 3, dark_mode: bool = False):
24+
def __init__(self, view: View, duration: float = 1.5, dark_mode: bool = False):
2525
super().__init__()
2626
self._next_view = view
2727
self._duration = duration

arcade/gui/ui_manager.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def on_draw():
8888

8989
_enabled = False
9090

91+
DEFAULT_LAYER = 0
9192
OVERLAY_LAYER = 10
9293

9394
def __init__(self, window: Optional[arcade.Window] = None):
@@ -103,7 +104,7 @@ def __init__(self, window: Optional[arcade.Window] = None):
103104

104105
self.register_event_type("on_event")
105106

106-
def add(self, widget: W, *, index=None, layer=0) -> W:
107+
def add(self, widget: W, *, index=None, layer=DEFAULT_LAYER) -> W:
107108
"""Add a widget to the :class:`UIManager`.
108109
109110
Added widgets will receive ui events and be rendered.
@@ -141,7 +142,9 @@ def remove(self, child: UIWidget):
141142
child.parent = None
142143
self.trigger_render()
143144

144-
def walk_widgets(self, *, root: Optional[UIWidget] = None, layer=0) -> Iterable[UIWidget]:
145+
def walk_widgets(
146+
self, *, root: Optional[UIWidget] = None, layer=DEFAULT_LAYER
147+
) -> Iterable[UIWidget]:
145148
"""Walks through widget tree, in reverse draw order (most top drawn widget first)
146149
147150
Args:
@@ -165,7 +168,9 @@ def clear(self):
165168
for widget in layer[:]:
166169
self.remove(widget)
167170

168-
def get_widgets_at(self, pos: Point2, cls: type[W] = UIWidget, layer=0) -> Iterable[W]:
171+
def get_widgets_at(
172+
self, pos: Point2, cls: type[W] = UIWidget, layer=DEFAULT_LAYER
173+
) -> Iterable[W]:
169174
"""Yields all widgets containing a position, returns first top laying widgets
170175
which is instance of cls.
171176

0 commit comments

Comments
 (0)