Skip to content
Extraits de code Groupes Projets
Valider 57a25300 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Scroll the audio display after a click near an edge

When auto scrolling is enabled, scroll the audio display after a click
near an edge to mimic the effect of scrolling to show the new audio
selection (as 2.1.9 did), but hopefully without all the weird
undesirable cases that had.
parent 05f5d375
Branches
Étiquettes
Aucune requête de fusion associée trouvée
......@@ -1010,11 +1010,23 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event)
if (event.IsButton())
SetFocus();
const int mouse_x = event.GetPosition().x;
// Scroll the display after a mouse-up near one of the edges
if ((event.LeftUp() || event.RightUp()) && OPT_GET("Audio/Auto/Scroll")->GetBool())
{
const int width = GetClientSize().GetWidth();
if (mouse_x < width / 20) {
ScrollBy(-width / 3);
}
else if (width - mouse_x < width / 20) {
ScrollBy(width / 3);
}
}
if (ForwardMouseEvent(event))
return;
const int mouse_x = event.GetPosition().x;
if (event.MiddleIsDown())
{
context->videoController->JumpToTime(TimeFromRelativeX(mouse_x), agi::vfr::EXACT);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter