-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement zooming by using mouse wheel
- Loading branch information
Showing
9 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2Canvas.class/instance/ctrlPressed..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
ctrlPressed: aBoolean | ||
ctrlPressed := aBoolean |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2Canvas.class/instance/ctrlPressed.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
ctrlPressed | ||
^ ctrlPressed ifNil: [ctrlPressed := false] |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2Canvas.class/instance/handlesKeyboard..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
event handling | ||
handlesKeyboard: evt | ||
^ true |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2Canvas.class/instance/handlesMouseWheel..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
event handling | ||
handlesMouseWheel: evt | ||
^ true | ||
This comment has been minimized.
Sorry, something went wrong. |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2Canvas.class/instance/keyDown..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
event handling | ||
keyDown: aKeyboardEvent | ||
aKeyboardEvent keyValue = 17 ifTrue: [self ctrlPressed: true] |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2Canvas.class/instance/keyUp..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
event handling | ||
keyUp: aKeyboardEvent | ||
aKeyboardEvent keyValue = 17 ifTrue: [self ctrlPressed: false] |
9 changes: 9 additions & 0 deletions
9
packages/SketchMorph2-Core.package/M2Canvas.class/instance/mouseWheel..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
event handling | ||
mouseWheel: evt | ||
self ctrlPressed ifFalse: [ | ||
(self ownerThatIsA: PluggableScrollPane) mouseWheel: evt] | ||
ifTrue: [evt isWheelDown | ||
ifFalse: [self zoomIn] | ||
ifTrue: [self zoomOut]] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Consider adding a newline here and in
handlesKeyboard
in the next commit.