MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / OnScrollTimer

Method OnScrollTimer

src/audio_display.cpp:1321–1338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1319}
1320
1321void AudioDisplay::OnScrollTimer(wxTimerEvent &event)
1322{
1323 if (!audio_marker) return;
1324
1325 int rel_x = RelativeXFromTime(audio_marker->GetPosition());
1326 int width = GetClientSize().GetWidth();
1327
1328 // If the dragged object is outside the visible area, scroll it into
1329 // view with a 5% margin
1330 if (rel_x < 0)
1331 {
1332 ScrollBy(rel_x - width / 20);
1333 }
1334 else if (rel_x >= width)
1335 {
1336 ScrollBy(rel_x - width + width / 20);
1337 }
1338}
1339
1340void AudioDisplay::OnStyleRangesChanged()
1341{

Callers

nothing calls this directly

Calls 2

GetPositionMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected