Added option to enable video panning

This commit is contained in:
Sodra 2022-03-02 18:24:17 -08:00
parent 36f7e102e2
commit b332181937
3 changed files with 26 additions and 10 deletions

View File

@ -611,6 +611,7 @@
"Fast Jump Step" : 10,
"Show Keyframes" : true
},
"Subtitle Sync" : true
"Subtitle Sync" : true,
"Video Pan": false
}
}

View File

@ -434,6 +434,9 @@ void Advanced_Video(wxTreebook *book, Preferences *parent) {
wxArrayString sp_choice = to_wx(SubtitlesProviderFactory::GetClasses());
p->OptionChoice(expert, _("Subtitles provider"), sp_choice, "Subtitle/Provider");
p->OptionChoice(expert, _("Video Panning"), "Video/Video Pan");
#ifdef WITH_AVISYNTH
auto avisynth = p->PageSizer("Avisynth");
p->OptionAdd(avisynth, _("Allow pre-2.56a Avisynth"), "Provider/Avisynth/Allow Ancient");

View File

@ -372,6 +372,10 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
last_mouse_pos = mouse_pos = event.GetPosition();
///if video pan
bool videoPan = OPT_GET("Video/Video Pan")->GetBool();
if (videoPan){
if (event.GetButton() == wxMOUSE_BTN_MIDDLE) {
if ((panning = event.ButtonDown()))
pan_last_pos = event.GetPosition();
@ -383,6 +387,14 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
PositionVideo();
}
}
else if ((pan_x != 0 || pan_y != 0) && !videoPan)
{
pan_x = pan_y = 0;
PositionVideo();
}
///
if (tool)
tool->OnMouseEvent(event);