Skip to content

Commit

Permalink
Fix minor warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ptsavol committed Dec 17, 2024
1 parent a663224 commit be0f512
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions spine_items/animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

"""Animation class for importers and exporters."""
from PySide6.QtCore import QLineF, QObject, QPointF, QRectF, Qt, QTimeLine, Signal, Slot
from PySide6.QtGui import QFont, QFontMetrics, QPainterPath
from PySide6.QtGui import QFont, QFontMetrics, QPainterPath, QColor
from PySide6.QtWidgets import QGraphicsPathItem
from spinetoolbox.helpers import color_from_index

Expand Down Expand Up @@ -47,7 +47,7 @@ def __init__(self, item, duration=1800, plane_count=4, pixel_size=12, loop_width
@Slot(float)
def _handle_time_line_value_changed(self, value):
for plane in self._planes:
plane.advance()
plane.advance(value)

@Slot(QTimeLine.State)
def _handle_time_line_state_changed(self, new_state):
Expand Down Expand Up @@ -135,7 +135,7 @@ def __init__(self, parent, font, trajectory_path, percent, step, loop_rect):
self._step = step
self._loop_rect = loop_rect
self._icon_code = "\uf1d8"
self.setAcceptedMouseButtons(Qt.NoButton)
self.setAcceptedMouseButtons(Qt.MouseButton.NoButton)
self.setZValue(self._parent.svg_item.zValue())
path = QPainterPath()
path.addText(0, (1 - 0.14) * QFontMetrics(font).height(), font, self._icon_code) # 14% baseline for FA
Expand All @@ -144,10 +144,10 @@ def __init__(self, parent, font, trajectory_path, percent, step, loop_rect):
border_pen = self.pen()
border_pen.setWidthF(0.5)
self.setPen(border_pen)
self.color = Qt.white
self.color = QColor(Qt.GlobalColor.white)
self.hide()

def advance(self):
def advance(self, phase):
self._percent = self._percent + self._step
if self._percent > 1:
self._percent = -0.8
Expand Down
2 changes: 1 addition & 1 deletion spine_items/tool/tool_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _handle_time_line_value_changed(self, value):
delta = QPointF(self._anim_delta_x_factor * value, delta_y)
self.svg_item.setPos(self._svg_item_pos + delta)

@Slot(int)
@Slot(QTimeLine.State)
def _handle_time_line_state_changed(self, new_state):
if new_state == QTimeLine.State.Running:
self.svg_item.setTransformOriginPoint(0, self._anim_transformation_origin_point_y)
Expand Down

0 comments on commit be0f512

Please sign in to comment.