-
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.
Merge pull request #79 from hpi-swa-teaching/feature/55-tool-preview
Add Tool Preview
- Loading branch information
Showing
39 changed files
with
222 additions
and
118 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/SketchMorph2-Core.package/M2Backend.class/instance/fillShape.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,7 @@ | ||
tool selection | ||
fillShape | ||
self context | ||
isErasing: false; | ||
mode: #fill; | ||
currentTool: #fillShape. | ||
self switchMode |
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
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2Canvas.class/instance/handlesMouseOver..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 | ||
handlesMouseOver: evt | ||
^ true |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2Canvas.class/instance/mouseLeave..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 | ||
mouseLeave: evt | ||
evt hand showTemporaryCursor: nil |
2 changes: 2 additions & 0 deletions
2
packages/SketchMorph2-Core.package/M2Canvas.class/instance/mouseMove..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
52 changes: 27 additions & 25 deletions
52
packages/SketchMorph2-Core.package/M2Canvas.class/methodProperties.json
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 |
---|---|---|
@@ -1,39 +1,41 @@ | ||
{ | ||
"class" : { | ||
"defaultCanvasSize" : "mFr 6/25/2021 08:47", | ||
"newWith:ofSize:" : "K.P. 6/26/2021 15:58" }, | ||
"defaultCanvasSize" : " 6/28/2021 21:03:28", | ||
"newWith:ofSize:" : " 6/28/2021 21:03:28" }, | ||
"instance" : { | ||
"addGripMorph:" : "JP 5/19/2021 00:31", | ||
"backend" : "mFr 6/9/2021 16:42", | ||
"backend" : "mk 7/27/2020 20:43", | ||
"extent:" : "wr 6/22/2020 16:26", | ||
"fastFramingOn" : "JP 5/19/2021 00:17", | ||
"gripMorph" : "CS 5/16/2021 20:20", | ||
"gripMorph:" : "CS 5/16/2021 20:21", | ||
"handlesKeyboard:" : "mFr 6/25/2021 14:57", | ||
"handlesKeyboard:" : " 6/28/2021 21:03:28", | ||
"handlesMouseDown:" : "mp 5/17/2020 11:53", | ||
"handlesMouseMove:" : "mp 5/17/2020 11:52", | ||
"handlesMouseOver:" : "mFr 6/11/2021 15:31", | ||
"handlesMouseOverDragging:" : "mp 5/17/2020 11:52", | ||
"handlesMouseWheel:" : "mFr 6/25/2021 14:57", | ||
"initialize" : "mFr 6/25/2021 08:46", | ||
"isControlKeyEvent:" : "JP 6/26/2021 17:27", | ||
"isCtrlPressed" : "K.P. 6/26/2021 15:28", | ||
"isCtrlPressed:" : "K.P. 6/26/2021 15:28", | ||
"isMouseDown:" : "K.P. 6/26/2021 15:24", | ||
"keyDown:" : "K.P. 6/26/2021 15:28", | ||
"keyUp:" : "K.P. 6/26/2021 15:28", | ||
"handlesMouseWheel:" : " 6/28/2021 21:03:28", | ||
"initialize" : "CS 6/2/2021 14:41", | ||
"isControlKeyEvent:" : " 6/28/2021 21:03:28", | ||
"isCtrlPressed" : " 6/28/2021 21:03:28", | ||
"isCtrlPressed:" : " 6/28/2021 21:03:28", | ||
"isMouseDown:" : "NC 5/16/2020 13:16", | ||
"keyDown:" : " 6/28/2021 21:03:28", | ||
"keyUp:" : " 6/28/2021 21:03:28", | ||
"maximumSize" : "CS 5/19/2021 19:50", | ||
"mouseDown:" : "K.P. 6/26/2021 15:25", | ||
"mouseEnterDragging:" : "JP 6/26/2021 17:46", | ||
"mouseLeaveDragging:" : "JP 6/26/2021 17:46", | ||
"mouseMove:" : "mFr 6/16/2021 16:46", | ||
"mouseUp:" : "K.P. 6/26/2021 15:36", | ||
"mouseWheel:" : "K.P. 6/26/2021 15:29", | ||
"mouseDown:" : "mk 7/3/2020 18:38", | ||
"mouseEnterDragging:" : "mp 7/27/2020 16:58", | ||
"mouseLeave:" : "JP 6/26/2021 18:18", | ||
"mouseLeaveDragging:" : "mFr 6/11/2021 14:36", | ||
"mouseMove:" : "CS 6/28/2021 21:31", | ||
"mouseUp:" : "mk 7/3/2020 19:27", | ||
"mouseWheel:" : " 6/28/2021 21:03:28", | ||
"relativeMousePosition:" : "mp 5/15/2020 12:42", | ||
"setCanvasSize:" : "mFr 6/24/2021 16:30", | ||
"updateExtent" : "K.P. 6/26/2021 15:38", | ||
"setCanvasSize:" : "CS 5/19/2021 19:50", | ||
"updateExtent" : " 6/28/2021 21:03:28", | ||
"updateGripMorphPosition" : "CS 5/17/2021 10:50", | ||
"viewPort" : "CS 6/11/2021 19:03", | ||
"viewPort:" : "CS 6/11/2021 19:13", | ||
"zoomDefault" : "jb 6/16/2021 21:11", | ||
"zoomIn" : "CS 6/16/2021 15:57", | ||
"zoomOut" : "CS 6/16/2021 15:57" } } | ||
"viewPort" : " 6/28/2021 21:03:28", | ||
"viewPort:" : " 6/28/2021 21:03:28", | ||
"zoomDefault" : " 6/28/2021 21:03:28", | ||
"zoomIn" : " 6/28/2021 21:03:28", | ||
"zoomOut" : " 6/28/2021 21:03:28" } } |
2 changes: 1 addition & 1 deletion
2
packages/SketchMorph2-Core.package/M2DrawingComponent.class/instance/drawTriangle.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
tool selection | ||
drawTriangle | ||
self pen sourceForm: self prepareTrianglePenSource | ||
self pen sourceForm: (self prepareTrianglePenSource offset: (self penNibOffset: self brushSize asPoint)) |
3 changes: 1 addition & 2 deletions
3
...s/SketchMorph2-Core.package/M2DrawingComponent.class/instance/prepareTrianglePenSource.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
5 changes: 5 additions & 0 deletions
5
packages/SketchMorph2-Core.package/M2DrawingComponent.class/instance/setPenColor..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,5 @@ | ||
accessing | ||
setPenColor: aColor | ||
self | ||
penColor: aColor; | ||
reloadCurrentPen |
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
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
2 changes: 1 addition & 1 deletion
2
packages/SketchMorph2-Core.package/M2IconMenuItem.class/class/getMenuItemForTarget..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
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
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/addText.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,4 @@ | ||
tool selection | ||
addText | ||
super addText. | ||
self currentCursor: Cursor text |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/circleCursor.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 @@ | ||
cursors | ||
circleCursor | ||
^ Form dotOfSize: self brushSize color: self penColor |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/currentCursor..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 | ||
currentCursor: aForm | ||
currentCursor := aForm |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/currentCursor.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 | ||
currentCursor | ||
^ currentCursor |
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/drawCircle.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,4 @@ | ||
tool selection | ||
drawCircle | ||
super drawCircle. | ||
self currentCursor: self circleCursor |
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/drawEraser.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,4 @@ | ||
tool selection | ||
drawEraser | ||
super drawEraser. | ||
self currentCursor: self eraserCursor |
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/drawGeometricCircle.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,4 @@ | ||
tool selection | ||
drawGeometricCircle | ||
super drawGeometricCircle. | ||
self currentCursor: Cursor crossHair |
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/drawGeometricRectangle.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,4 @@ | ||
tool selection | ||
drawGeometricRectangle | ||
super drawGeometricRectangle. | ||
self currentCursor: Cursor crossHair |
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/drawPencil.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,4 @@ | ||
tool selection | ||
drawPencil | ||
super drawPencil. | ||
self currentCursor: (CursorWithAlpha fromIcon: M2Pencil icon) |
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/drawRectangle.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,4 @@ | ||
tool selection | ||
drawRectangle | ||
super drawRectangle. | ||
self currentCursor: self rectangleCursor |
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/drawTriangle.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,4 @@ | ||
tool selection | ||
drawTriangle | ||
super drawTriangle. | ||
self currentCursor: self triangleCursor |
8 changes: 8 additions & 0 deletions
8
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/eraserCursor.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,8 @@ | ||
cursors | ||
eraserCursor | ||
^ CircleMorph new | ||
extent: self eraserSize asPoint; | ||
color: Color white; | ||
borderWidth: 1; | ||
borderColor: Color black; | ||
imageForm |
4 changes: 4 additions & 0 deletions
4
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/fillShape.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,4 @@ | ||
tool selection | ||
fillShape | ||
super fillShape. | ||
self currentCursor: (CursorWithAlpha fromIcon: M2FillArea icon) |
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
5 changes: 5 additions & 0 deletions
5
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/rectangleCursor.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,5 @@ | ||
cursors | ||
rectangleCursor | ||
^ (Form extent: self rectangleBrushSize depth: self defaultDepth) | ||
offset: ((self rectangleBrushSize x / 2) @ 0); | ||
fillWithColor: self context currentColor |
5 changes: 5 additions & 0 deletions
5
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/triangleCursor.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,5 @@ | ||
cursors | ||
triangleCursor | ||
^ (Form extent: self brushSize asPoint depth: self defaultDepth) | ||
fillShape: self prepareTrianglePenSource | ||
fillColor: self context currentColor |
2 changes: 1 addition & 1 deletion
2
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/zoomMax.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
zooming | ||
zoomMax | ||
^ 8 | ||
^ 3 |
Oops, something went wrong.