MCPcopy Create free account
hub / github.com/clementgallet/libTAS / update

Method update

src/program/ui/InputEditorView.cpp:260–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260void InputEditorView::update()
261{
262 static uint64_t last_framecount = -1;
263 if (last_framecount == context->framecount)
264 return;
265
266 last_framecount = context->framecount;
267
268 inputEditorModel->update();
269
270 if (!isVisible())
271 return;
272
273 /* Check if scroll is frozen because of a rewind. Disable scroll freeze when
274 * reaching the paused frame. */
275 if (inputEditorModel->isScrollFreeze()) {
276 if (context->seek_frame == 0) {
277 inputEditorModel->setScrollFreeze(false);
278 autoScroll = false;
279 }
280
281 if (inputEditorModel->isScrollFreeze())
282 return;
283 }
284
285 /* Don't autoscroll if disabled in the user options */
286 if (!context->config.editor_autoscroll)
287 return;
288
289 /* Enable autoscroll if current frame is not visible */
290 int toprow = verticalScrollBar()->value();
291 int bottomrow = toprow + verticalScrollBar()->pageStep();
292 if ((context->framecount >= static_cast<unsigned int>(bottomrow)) || (context->framecount < static_cast<unsigned int>(toprow))) {
293 autoScroll = true;
294 }
295
296 /* If autoscroll is enable, scroll to make the current frame visible */
297 if (autoScroll) {
298 scrollToFrame(context->framecount);
299 }
300}
301
302void InputEditorView::scrollToFrame(unsigned long long frame)
303{

Callers

nothing calls this directly

Calls 3

isScrollFreezeMethod · 0.80
setScrollFreezeMethod · 0.80
valueMethod · 0.80

Tested by

no test coverage detected