Skip to content

Commit

Permalink
Add animation to affected vertices
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdwetering committed Aug 1, 2024
1 parent e11734d commit f965866
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions zxlive/editor_base_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .common import VT, GraphT, ToolType, get_data
from .dialogs import show_error_msg
from .eitem import EItem, HAD_EDGE_BLUE, EItemAnimation
from .vitem import VItem, BLACK
from .vitem import VItem, BLACK, VItemAnimation
from .graphscene import EditGraphScene
from .settings import display_setting

Expand Down Expand Up @@ -206,7 +206,11 @@ def dist(vitem: VItem) -> float:
pairs.append((vs[-1],v))
cmd = AddEdges(self.graph_view, pairs, self._curr_ety)
self.undo_stack.push(cmd)

group = QParallelAnimationGroup()
for vitem in verts:
anim = animations.scale(vitem,1.0,400,QEasingCurve(QEasingCurve.Type.InCubic),start=1.3)
group.addAnimation(anim)
self.undo_stack.set_anim(group)

def vert_moved(self, vs: list[tuple[VT, float, float]]) -> None:
self.undo_stack.push(MoveNode(self.graph_view, vs))
Expand Down

0 comments on commit f965866

Please sign in to comment.