Skip to content

Commit 9871e18

Browse files
Change the self._scale calls to self.scale in the anchored_position getter and setter.
1 parent 627563b commit 9871e18

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

adafruit_display_text/label.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,13 @@ def anchored_position(self):
435435
return (
436436
int(
437437
self.x
438-
+ (self._boundingbox[0] * self._scale)
439-
+ round(self._anchor_point[0] * self._boundingbox[2] * self._scale)
438+
+ (self._boundingbox[0] * self.scale)
439+
+ round(self._anchor_point[0] * self._boundingbox[2] * self.scale)
440440
),
441441
int(
442442
self.y
443-
+ (self._boundingbox[1] * self._scale)
444-
+ round(self._anchor_point[1] * self._boundingbox[3] * self._scale)
443+
+ (self._boundingbox[1] * self.scale)
444+
+ round(self._anchor_point[1] * self._boundingbox[3] * self.scale)
445445
),
446446
)
447447

@@ -451,11 +451,11 @@ def anchored_position(self, new_position):
451451
return # Note: anchor_point must be set before setting anchored_position
452452
self.x = int(
453453
new_position[0]
454-
- (self._boundingbox[0] * self._scale)
455-
- round(self._anchor_point[0] * (self._boundingbox[2] * self._scale))
454+
- (self._boundingbox[0] * self.scale)
455+
- round(self._anchor_point[0] * (self._boundingbox[2] * self.scale))
456456
)
457457
self.y = int(
458458
new_position[1]
459-
- (self._boundingbox[1] * self._scale)
460-
- round(self._anchor_point[1] * self._boundingbox[3] * self._scale)
459+
- (self._boundingbox[1] * self.scale)
460+
- round(self._anchor_point[1] * self._boundingbox[3] * self.scale)
461461
)

0 commit comments

Comments
 (0)