MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / onRemoveFrame

Method onRemoveFrame

src/app/ui/timeline.cpp:1125–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1123}
1124
1125void Timeline::onRemoveFrame(doc::DocumentEvent& ev)
1126{
1127 // Adjust current frame of all editors that are in a frame more
1128 // advanced that the removed one.
1129 if (getFrame() > ev.frame()) {
1130 setFrame(getFrame()-1, false);
1131 }
1132 // If the editor was in the previous "last frame" (current value of
1133 // totalFrames()), we've to adjust it to the new last frame
1134 // (lastFrame())
1135 else if (getFrame() >= sprite()->totalFrames()) {
1136 setFrame(sprite()->lastFrame(), false);
1137 }
1138
1139 // Disable the selected range when we remove frames
1140 if (m_range.enabled())
1141 m_range.disableRange();
1142
1143 showCurrentCel();
1144 clearClipboardRange();
1145 invalidate();
1146}
1147
1148void Timeline::onSelectionChanged(doc::DocumentEvent& ev)
1149{

Callers

nothing calls this directly

Calls 5

totalFramesMethod · 0.80
disableRangeMethod · 0.80
frameMethod · 0.45
lastFrameMethod · 0.45
enabledMethod · 0.45

Tested by

no test coverage detected