Mercurial > octave
comparison libgui/graphics/Canvas.cc @ 29054:226df400639c
maint: merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 12 Nov 2020 02:02:39 -0500 |
parents | 1ac5a76ae91d 440ace36950e |
children | 7854d5752dd2 |
comparison
equal
deleted
inserted
replaced
29046:cde4b1d9f6ef | 29054:226df400639c |
---|---|
918 { | 918 { |
919 graphics_object childObj (gh_mgr.get_object (children(i))); | 919 graphics_object childObj (gh_mgr.get_object (children(i))); |
920 | 920 |
921 if (childObj.isa ("axes")) | 921 if (childObj.isa ("axes")) |
922 { | 922 { |
923 graphics_object go = selectFromAxes (childObj, event->pos ()); | 923 #if defined (HAVE_QWHEELEVENT_POSITION) |
924 QPoint pos = event->position().toPoint (); | |
925 #else | |
926 QPoint pos = event->pos (); | |
927 #endif | |
928 graphics_object go = selectFromAxes (childObj, pos); | |
924 | 929 |
925 if (go) | 930 if (go) |
926 { | 931 { |
927 axesObj = childObj; | 932 axesObj = childObj; |
928 break; | 933 break; |
944 Utils::properties<figure> (figObj) | 949 Utils::properties<figure> (figObj) |
945 .set_currentaxes (axesObj.get_handle ().as_octave_value ()); | 950 .set_currentaxes (axesObj.get_handle ().as_octave_value ()); |
946 | 951 |
947 if (zoom_enabled (figObj)) | 952 if (zoom_enabled (figObj)) |
948 { | 953 { |
954 #if defined (HAVE_QWHEELEVENT_ANGLEDELTA) | |
955 if (event->angleDelta().y () > 0) | |
956 #else | |
949 if (event->delta () > 0) | 957 if (event->delta () > 0) |
958 #endif | |
950 newMouseMode = ZoomInMode; | 959 newMouseMode = ZoomInMode; |
951 else | 960 else |
952 newMouseMode = ZoomOutMode; | 961 newMouseMode = ZoomOutMode; |
953 | 962 |
954 mode = zoom_mode (figObj); | 963 mode = zoom_mode (figObj); |
986 | 995 |
987 case PanMode: | 996 case PanMode: |
988 { | 997 { |
989 axes::properties& ap = Utils::properties<axes> (axesObj); | 998 axes::properties& ap = Utils::properties<axes> (axesObj); |
990 | 999 |
1000 #if defined (HAVE_QWHEELEVENT_ANGLEDELTA) | |
1001 double factor = (event->angleDelta().y () > 0 ? 0.1 : -0.1); | |
1002 #else | |
991 double factor = (event->delta () > 0 ? 0.1 : -0.1); | 1003 double factor = (event->delta () > 0 ? 0.1 : -0.1); |
1004 #endif | |
992 | 1005 |
993 if (event->modifiers () == Qt::NoModifier | 1006 if (event->modifiers () == Qt::NoModifier |
994 && mode != "horizontal") | 1007 && mode != "horizontal") |
995 ap.pan ("vertical", factor); | 1008 ap.pan ("vertical", factor); |
996 else if (event->modifiers () == Qt::ShiftModifier | 1009 else if (event->modifiers () == Qt::ShiftModifier |