File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -84,4 +84,14 @@ export default {
8484 onChangeEvent : "toggleSmoothing" ,
8585 defaultValue : true ,
8686 } ,
87+ invertedZoom : {
88+ newUI : {
89+ tags : "Image Tag" ,
90+ title : "Invert zoom direction" ,
91+ description : "Invert the direction of scroll-to-zoom" ,
92+ } ,
93+ description : "Enable inverted zoom direction" ,
94+ onChangeEvent : "toggleInvertedZoom" ,
95+ defaultValue : false ,
96+ } ,
8797} ;
Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ const SettingsModel = types
7272 isDestroying : types . optional ( types . boolean , false ) ,
7373
7474 videoDrawOutside : types . optional ( types . boolean , false ) ,
75+
76+ invertedZoom : types . optional ( types . boolean , false ) ,
7577 } )
7678 . views ( ( self ) => ( {
7779 get annotation ( ) {
@@ -231,6 +233,14 @@ const SettingsModel = types
231233 self . enableSmoothing = value ;
232234 } ,
233235
236+ toggleInvertedZoom ( ) {
237+ self . invertedZoom = ! self . invertedZoom ;
238+ } ,
239+
240+ setInvertedZoom ( value ) {
241+ self . invertedZoom = value ;
242+ } ,
243+
234244 setVideoHopSize ( value ) {
235245 self . videoHopSize = value ;
236246 } ,
Original file line number Diff line number Diff line change @@ -931,12 +931,14 @@ const Model = types
931931 } ,
932932
933933 getInertialZoom ( val ) {
934+ const invert = getRoot ( self ) . settings . invertedZoom ? 1 : - 1 ;
935+
934936 // Invert the delta value so that:
935937 // - Pinch out (positive deltaY) zooms in
936938 // - Pinch in (negative deltaY) zooms out
937939 // - Scroll up (positive deltaY) zooms in
938940 // - Scroll down (negative deltaY) zooms out
939- const invertedVal = - val ;
941+ const invertedVal = val * invert ;
940942
941943 // Calculate the zoom change using exponential formula
942944 // This provides smooth zooming for both mouse wheel and trackpad pinch
You can’t perform that action at this time.
0 commit comments