Skip to content

Commit

Permalink
fix text for uturn
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Nov 4, 2024
1 parent 161b447 commit 654a55b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/python/plotlyst/view/widget/scene/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,13 @@ def _draw(self, painter: QPainter):
draw_rect(painter, self._arcRect)

painter.setPen(QPen(QColor('black'), 1))
painter.drawText(0, y, self._beat.width, self._timelineHeight, Qt.AlignmentFlag.AlignCenter, self._beat.text)
if self._globalAngle >= 0:
painter.drawText(self.OFFSET, y, self._beat.width, self._timelineHeight, Qt.AlignmentFlag.AlignCenter,
self._beat.text)
else:
painter.drawText(int(self._arcRect.x() + self._arcRect.width() - self.OFFSET), y, self._beat.width,
self._timelineHeight,
Qt.AlignmentFlag.AlignCenter, self._beat.text)


class _BaseShapeItem(QGraphicsPolygonItem):
Expand Down Expand Up @@ -514,7 +520,7 @@ def __init__(self, novel: Novel, parent=None):
item = self.addNewItem(SceneBeat(text='Falling', angle=-45, color='green'), item)
item = self.addNewItem(SceneBeat('3/a'), item)
item = self.addNewItem(SceneBeat('3/b'), item)
item = self.addNewItem(SceneBeat(text='Rising', angle=45, color='green'), item)
# item = self.addNewItem(SceneBeat(text='Rising', angle=45, color='green'), item)
# item = self.addNewItem(SceneBeat(text='Falling', angle=-45, color='green'), item)

self._drawBottom()
Expand Down

0 comments on commit 654a55b

Please sign in to comment.