mirror of https://github.com/odrling/Aegisub
Added option to enable video panning
This commit is contained in:
parent
36f7e102e2
commit
b332181937
|
@ -611,6 +611,7 @@
|
|||
"Fast Jump Step" : 10,
|
||||
"Show Keyframes" : true
|
||||
},
|
||||
"Subtitle Sync" : true
|
||||
"Subtitle Sync" : true,
|
||||
"Video Pan": false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue