diff --git a/src/libresrc/default_config.json b/src/libresrc/default_config.json index 318f8d3ee..e177379b2 100644 --- a/src/libresrc/default_config.json +++ b/src/libresrc/default_config.json @@ -611,6 +611,7 @@ "Fast Jump Step" : 10, "Show Keyframes" : true }, - "Subtitle Sync" : true + "Subtitle Sync" : true, + "Video Pan": false } } diff --git a/src/preferences.cpp b/src/preferences.cpp index f6320dd75..f0e1f6ff3 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -433,6 +433,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"); diff --git a/src/video_display.cpp b/src/video_display.cpp index 57db99195..8598eae5c 100644 --- a/src/video_display.cpp +++ b/src/video_display.cpp @@ -372,17 +372,29 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) { last_mouse_pos = mouse_pos = event.GetPosition(); - if (event.GetButton() == wxMOUSE_BTN_MIDDLE) { - if ((panning = event.ButtonDown())) - pan_last_pos = event.GetPosition(); - } - if (panning && event.Dragging()) { - pan_x += event.GetX() - pan_last_pos.X(); - pan_y += event.GetY() - pan_last_pos.Y(); - pan_last_pos = event.GetPosition(); + ///if video pan + bool videoPan = OPT_GET("Video/Video Pan")->GetBool(); - PositionVideo(); + if (videoPan){ + if (event.GetButton() == wxMOUSE_BTN_MIDDLE) { + if ((panning = event.ButtonDown())) + pan_last_pos = event.GetPosition(); + } + if (panning && event.Dragging()) { + pan_x += event.GetX() - pan_last_pos.X(); + pan_y += event.GetY() - pan_last_pos.Y(); + pan_last_pos = event.GetPosition(); + + PositionVideo(); + } } + else if ((pan_x != 0 || pan_y != 0) && !videoPan) + { + pan_x = pan_y = 0; + PositionVideo(); + } + + /// if (tool) tool->OnMouseEvent(event);