File tree Expand file tree Collapse file tree
src/wwwroot/js/genpage/helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -520,9 +520,7 @@ class ImageEditor {
520520 } ) ;
521521 canvas . addEventListener ( 'drop' , ( e ) => this . handleCanvasImageDrop ( e ) ) ;
522522 canvas . addEventListener ( 'contextmenu' , ( e ) => {
523- if ( this . activeTool && this . activeTool . onContextMenu ( e ) ) {
524- e . preventDefault ( ) ;
525- }
523+ e . preventDefault ( ) ;
526524 } ) ;
527525 this . ctx = canvas . getContext ( '2d' ) ;
528526 canvas . style . cursor = 'none' ;
@@ -724,16 +722,20 @@ class ImageEditor {
724722 }
725723
726724 onMouseDown ( e ) {
725+ // 1 = middle, 2 = right
727726 if ( this . altDown || e . button == 1 ) {
728727 this . handleAltDown ( ) ;
729728 }
729+ if ( e . button == 2 && this . activeTool && ! this . activeTool . onContextMenu ( e ) ) {
730+ this . handleAltDown ( ) ;
731+ }
730732 this . mouseDown = true ;
731733 this . activeTool . onMouseDown ( e ) ;
732734 this . redraw ( ) ;
733735 }
734736
735737 onMouseUp ( e ) {
736- if ( e . button == 1 ) {
738+ if ( e . button == 1 || e . button == 2 ) {
737739 this . handleAltUp ( ) ;
738740 }
739741 this . mouseDown = false ;
You can’t perform that action at this time.
0 commit comments