| 1123 | } |
| 1124 | |
| 1125 | void 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 | |
| 1148 | void Timeline::onSelectionChanged(doc::DocumentEvent& ev) |
| 1149 | { |
nothing calls this directly
no test coverage detected