Skip to content

Commit a56e59f

Browse files
committed
new vectorio API
1 parent 23768a2 commit a56e59f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

displayio_dial.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def _initialize_dial(self, width, height):
378378

379379
# create the needle
380380
self._create_needle()
381-
self.append(self._needle_vector_shape)
381+
self.append(self._needle)
382382
self._update_needle(self._value)
383383

384384
def _adjust_dimensions(self, width, height):
@@ -462,15 +462,11 @@ def _get_font_height(self, font, scale):
462462

463463
def _create_needle(self):
464464
# Create the needle
465-
self._needle_palette = displayio.Palette(2)
466-
self._needle_palette.make_transparent(0)
467-
self._needle_palette[1] = self._needle_color
465+
self._needle_palette = displayio.Palette(1)
466+
self._needle_palette[0] = self._needle_color
468467

469468
self._needle = vectorio.Polygon(
470-
points=[(100, 100), (100, 50), (50, 50), (50, 100)]
471-
)
472-
self._needle_vector_shape = vectorio.VectorShape(
473-
shape=self._needle,
469+
points=[(100, 100), (100, 50), (50, 50), (50, 100)],
474470
pixel_shader=self._needle_palette,
475471
x=0,
476472
y=0,

0 commit comments

Comments
 (0)