We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc3dcd2 commit 42579f8Copy full SHA for 42579f8
adafruit_display_text/label.py
@@ -385,7 +385,7 @@ def anchored_position(self):
385
if self._anchor_point is None:
386
return None
387
return (
388
- int(self.x + (self._anchor_point[0] * self._boundingbox[2] * self._scale)),
+ int(self.x + round(self._anchor_point[0] * self._boundingbox[2] * self._scale)),
389
int(
390
self.y
391
+ (self._anchor_point[1] * self._boundingbox[3] * self._scale)
@@ -399,7 +399,7 @@ def anchored_position(self, new_position):
399
return # Note: anchor_point must be set before setting anchored_position
400
new_x = int(
401
new_position[0]
402
- - self._anchor_point[0] * (self._boundingbox[2] * self._scale)
+ - round(self._anchor_point[0] * (self._boundingbox[2] * self._scale))
403
)
404
new_y = int(
405
new_position[1]
0 commit comments