Skip to content

Commit

Permalink
Check if offset before attempting to shift x
Browse files Browse the repository at this point in the history
  • Loading branch information
kajuberdut committed Nov 16, 2023
1 parent b924733 commit 18dabc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/roadmapper/milestone.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def apply_offset(self, alignment: Alignment, painter: Painter) -> None:
)
offset = alignment.percent_of(text_width)

if direction == AlignmentDirection.RIGHT:
if direction == AlignmentDirection.RIGHT and offset:
self.text_x += offset
elif alignment == AlignmentDirection.LEFT:
elif alignment == AlignmentDirection.LEFT and offset:
self.text_x -= offset

0 comments on commit 18dabc1

Please sign in to comment.