Skip to content

Commit b66efa1

Browse files
author
Margaret Matocha
committed
Deleted else and corrected tabbing
1 parent e89c457 commit b66efa1

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

adafruit_display_text/label.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,14 @@ def anchored_position(self):
397397
def anchored_position(self, new_position):
398398
if (self._anchor_point is None) or (new_position is None):
399399
return # Note: anchor_point must be set before setting anchored_position
400-
else:
401-
new_x = int(
402-
new_position[0]
403-
- self._anchor_point[0] * (self._boundingbox[2] * self._scale)
404-
)
405-
new_y = int(
406-
new_position[1]
407-
- (self._anchor_point[1] * self._boundingbox[3] * self._scale)
408-
+ round((self._boundingbox[3] * self._scale) / 2.0)
409-
)
410-
self.x = new_x
411-
self.y = new_y
400+
new_x = int(
401+
new_position[0]
402+
- self._anchor_point[0] * (self._boundingbox[2] * self._scale)
403+
)
404+
new_y = int(
405+
new_position[1]
406+
- (self._anchor_point[1] * self._boundingbox[3] * self._scale)
407+
+ round((self._boundingbox[3] * self._scale) / 2.0)
408+
)
409+
self.x = new_x
410+
self.y = new_y

0 commit comments

Comments
 (0)