From: foamyguy Date: Thu, 17 Apr 2025 21:44:10 +0000 (-0500) Subject: Merge pull request #159 from philrittenhouse/main X-Git-Tag: 2.1.8 X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/commitdiff_plain/6ec826343a80d316d7b90484750256cd5adc57bc?hp=c0c122e7b04612ccb0cdea6a11ae117aab727436 Merge pull request #159 from philrittenhouse/main Fixes for issue #158 --- diff --git a/README.rst b/README.rst index 8007209..4338cae 100644 --- a/README.rst +++ b/README.rst @@ -58,6 +58,8 @@ Contributions are welcome! Please read our `Code of Conduct `_ before contributing to help this project stay welcoming. +To make sure your pull request will pass the commit checks, use pre-commit to check your code formatting. Please see the guide page here for more details: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github/check-your-code + Documentation ============= diff --git a/displayio/_area.py b/displayio/_area.py index f7272dd..0b3dd80 100644 --- a/displayio/_area.py +++ b/displayio/_area.py @@ -87,10 +87,10 @@ class Area: def union(self, other, union): """Combine this area along with another into union""" if self.empty(): - self.copy_into(union) + other.copy_into(union) return if other.empty(): - other.copy_into(union) + self.copy_into(union) return union.x1 = min(self.x1, other.x1) diff --git a/vectorio/_circle.py b/vectorio/_circle.py index cc87351..339b154 100644 --- a/vectorio/_circle.py +++ b/vectorio/_circle.py @@ -61,7 +61,7 @@ class Circle(_VectorShape): def radius(self, value: int) -> None: if value < 1: raise ValueError("radius must be >= 1") - self._radius = abs(value) + self._radius = int(value) # other code assumes radius is an integer self._shape_set_dirty() @property diff --git a/vectorio/_vectorshape.py b/vectorio/_vectorshape.py index d3d1ddb..735e5ae 100644 --- a/vectorio/_vectorshape.py +++ b/vectorio/_vectorshape.py @@ -122,9 +122,12 @@ class _VectorShape: self._get_screen_area(current_area) moved = current_area != self._current_area if moved: + # This will add _current_area (the old position) to dirty area self._current_area.union( self._ephemeral_dirty_area, self._ephemeral_dirty_area ) + # This will add the new position to the dirty area + current_area.union(self._ephemeral_dirty_area, self._ephemeral_dirty_area) # Dirty area tracks the shape's footprint between draws. It's reset on refresh finish. current_area.copy_into(self._current_area) self._current_area_dirty = True