Skip to content

Commit fa4ca74

Browse files
committed
Removing Max Group
1 parent aa90308 commit fa4ca74

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples/slider_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Create the slider
2727
my_slider = Slider(20, 30)
2828

29-
my_group = displayio.Group(max_size=5)
29+
my_group = displayio.Group()
3030
my_group.append(my_slider)
3131

3232
# Add my_group to the display

slider.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class Slider(Widget, Control):
110110
.. code-block:: python
111111
112112
my_slider= Slider(20, 30)
113-
my_group = displayio.Group(max_size=10) # make a group that can hold 10 items
113+
my_group = displayio.Group() # make a group
114114
my_group.append(my_slider) # Add my_slider to the group
115115
116116
#
@@ -185,8 +185,7 @@ def __init__(
185185
):
186186

187187
Widget.__init__(
188-
self, x=x, y=y, height=height, width=width, **kwargs, max_size=4
189-
)
188+
self, x=x, y=y, height=height, width=width, **kwargs)
190189
Control.__init__(self)
191190

192191
self._knob_width = height // 2
@@ -317,7 +316,8 @@ def when_selected(self, touch_point):
317316

318317
touch_y = touch_point[1] - self.y
319318

320-
super().selected((touch_x, touch_y, 0))
319+
self.selected((touch_x, touch_y, 0))
320+
self._switch_handle.x = touch_x
321321
return self._switch_handle.x
322322

323323
def when_inside(self, touch_point):
@@ -332,7 +332,7 @@ def when_inside(self, touch_point):
332332
) # adjust touch position for the local position
333333
touch_y = touch_point[1] - self.y
334334

335-
return super().contains((touch_x, touch_y, 0))
335+
return self.contains((touch_x, touch_y, 0))
336336

337337
@property
338338
def value(self):

0 commit comments

Comments
 (0)