forked from mia/Aegisub
Add mouse wheel video zooming
Originally committed to SVN as r4276.
This commit is contained in:
parent
81282bf06e
commit
5215049c07
1 changed files with 5 additions and 1 deletions
|
@ -487,6 +487,10 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
|
||||||
if (event.ButtonDown(wxMOUSE_BTN_ANY)) {
|
if (event.ButtonDown(wxMOUSE_BTN_ANY)) {
|
||||||
SetFocus();
|
SetFocus();
|
||||||
}
|
}
|
||||||
|
int wheel = event.GetWheelRotation();
|
||||||
|
if (wheel) {
|
||||||
|
SetZoom (zoomValue + .125 * (wheel / event.GetWheelDelta()));
|
||||||
|
}
|
||||||
|
|
||||||
// Send to visual
|
// Send to visual
|
||||||
if (visual) visual->OnMouseEvent(event);
|
if (visual) visual->OnMouseEvent(event);
|
||||||
|
@ -515,7 +519,7 @@ void VideoDisplay::OnKey(wxKeyEvent &event) {
|
||||||
void VideoDisplay::SetZoom(double value) {
|
void VideoDisplay::SetZoom(double value) {
|
||||||
using std::max;
|
using std::max;
|
||||||
zoomValue = max(value, .125);
|
zoomValue = max(value, .125);
|
||||||
zoomBox->SetValue(wxString::Format("%g%%", value * 100.));
|
zoomBox->SetValue(wxString::Format("%g%%", zoomValue * 100.));
|
||||||
UpdateSize();
|
UpdateSize();
|
||||||
}
|
}
|
||||||
void VideoDisplay::SetZoomFromBox() {
|
void VideoDisplay::SetZoomFromBox() {
|
||||||
|
|
Loading…
Reference in a new issue