-
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 remote-tracking branch 'origin/119-add-ability-to-mirror-select…
…ed-shapes' into 123-refactor-tools
- Loading branch information
Showing
47 changed files
with
224 additions
and
79 deletions.
There are no files selected for viewing
Empty file.
2 changes: 1 addition & 1 deletion
2
...lipVertical.class/class/actionSelector.st → ...kage/M2Flip.class/class/actionSelector.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 @@ | ||
as yet unclassified | ||
actionSelector | ||
^ #mirrorVertical | ||
^ #Platzhalter |
6 changes: 6 additions & 0 deletions
6
packages/SketchMorph2-Core.package/M2Flip.class/class/onClick..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,6 @@ | ||
as yet unclassified | ||
onClick: anM2DrawingContext | ||
| tool | | ||
tool := anM2DrawingContext cachedTool: #select ifAbsent: [^ self clickMenuItemWith: M2SelectRectangle label]. | ||
(tool isActive and: [tool nextStartFinishes]) | ||
ifTrue: [self mirror: tool] |
6 changes: 6 additions & 0 deletions
6
packages/SketchMorph2-Core.package/M2Flip.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"class" : { | ||
"actionSelector" : "AG 7/19/2022 12:16", | ||
"onClick:" : "AG 7/19/2022 12:20" }, | ||
"instance" : { | ||
} } |
14 changes: 14 additions & 0 deletions
14
packages/SketchMorph2-Core.package/M2Flip.class/properties.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "SketchMorph2-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "M2Flip", | ||
"pools" : [ | ||
], | ||
"super" : "M2IconMenuItem", | ||
"type" : "normal" } |
3 changes: 0 additions & 3 deletions
3
packages/SketchMorph2-Core.package/M2FlipHorizontal.class/class/actionSelector.st
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2FlipHorizontal.class/class/mirror..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 @@ | ||
as yet unclassified | ||
mirror: anM2Tool | ||
anM2Tool mirrorHorizontal |
4 changes: 2 additions & 2 deletions
4
packages/SketchMorph2-Core.package/M2FlipHorizontal.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,8 +1,8 @@ | ||
{ | ||
"class" : { | ||
"actionSelector" : "AG 6/21/2022 12:16", | ||
"icon" : "KR 6/23/2022 13:17", | ||
"isActivatable" : "AG 6/21/2022 12:10", | ||
"label" : "AG 6/21/2022 12:21" }, | ||
"label" : "AG 6/21/2022 12:21", | ||
"mirror:" : "AG 7/19/2022 13:49" }, | ||
"instance" : { | ||
} } |
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 |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"name" : "M2FlipHorizontal", | ||
"pools" : [ | ||
], | ||
"super" : "M2IconMenuItem", | ||
"super" : "M2Flip", | ||
"type" : "normal" } |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Core.package/M2FlipVertical.class/class/mirror..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 @@ | ||
as yet unclassified | ||
mirror: anM2Tool | ||
anM2Tool mirrorVertical |
4 changes: 2 additions & 2 deletions
4
packages/SketchMorph2-Core.package/M2FlipVertical.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,8 +1,8 @@ | ||
{ | ||
"class" : { | ||
"actionSelector" : "AG 6/21/2022 12:24", | ||
"icon" : "KR 6/23/2022 13:17", | ||
"isActivatable" : "AG 6/21/2022 12:23", | ||
"label" : "AG 6/21/2022 12:24" }, | ||
"label" : "AG 6/21/2022 12:24", | ||
"mirror:" : "AG 7/19/2022 13:49" }, | ||
"instance" : { | ||
} } |
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 |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"name" : "M2FlipVertical", | ||
"pools" : [ | ||
], | ||
"super" : "M2IconMenuItem", | ||
"super" : "M2Flip", | ||
"type" : "normal" } |
15 changes: 0 additions & 15 deletions
15
packages/SketchMorph2-Core.package/M2TemporaryGeometricMorph.class/instance/mirror..st
This file was deleted.
Oops, something went wrong.
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
10 changes: 0 additions & 10 deletions
10
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/mirror.at..st
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/mirrorHorizontal.st
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/SketchMorph2-Core.package/M2ViewPort.class/instance/mirrorVertical.st
This file was deleted.
Oops, something went wrong.
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
8 changes: 8 additions & 0 deletions
8
...SketchMorph2-Tests.package/M2DrawingComponentTests.class/class/mirroredLassoHorizontal.st
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...s/SketchMorph2-Tests.package/M2DrawingComponentTests.class/class/mirroredLassoVertical.st
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...chMorph2-Tests.package/M2DrawingComponentTests.class/class/mirroredRectangleHorizontal.st
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...etchMorph2-Tests.package/M2DrawingComponentTests.class/class/mirroredRectangleVertical.st
Large diffs are not rendered by default.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...-Tests.package/M2DrawingComponentTests.class/instance/testFormAfterLassoHorizontalFlip.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,12 @@ | ||
testing | ||
testFormAfterLassoHorizontalFlip | ||
self | ||
contextFillGeometricModeWithForm: #ellipse; | ||
drawFrom: (10 @ 10) to: (50 @ 90). | ||
self backend clickAt: 50 asPoint. | ||
self | ||
contextSelectionLassoMode; | ||
dragAlong: {30 @ 50 . 40 @ 20 . 60 @ 5 . 60 @ 95 . 45 @ 70 . 35 @ 55}. | ||
self viewPort mirrorHorizontal. | ||
self backend clickAt: 50 asPoint. | ||
self compareBackendFormWith: #mirroredLassoHorizontal |
12 changes: 12 additions & 0 deletions
12
...h2-Tests.package/M2DrawingComponentTests.class/instance/testFormAfterLassoVerticalFlip.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,12 @@ | ||
testing | ||
testFormAfterLassoVerticalFlip | ||
self | ||
contextFillGeometricModeWithForm: #ellipse; | ||
drawFrom: (10 @ 5) to: (90 @ 45). | ||
self backend clickAt: 50 asPoint. | ||
self | ||
contextSelectionLassoMode; | ||
dragAlong: {5 @ 50 . 50 @ 15 . 70 @ 5 . 95 @ 46}. | ||
self viewPort mirrorVertical. | ||
self backend clickAt: 50 asPoint. | ||
self compareBackendFormWith: #mirroredLassoVertical |
12 changes: 12 additions & 0 deletions
12
...ts.package/M2DrawingComponentTests.class/instance/testFormAfterRectangleHorizontalFlip.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,12 @@ | ||
testing | ||
testFormAfterRectangleHorizontalFlip | ||
self | ||
contextFillGeometricModeWithForm: #ellipse; | ||
drawFrom: (40 @ 10) to: (80 @ 90). | ||
self backend clickAt: 50 asPoint. | ||
self | ||
contextSelectionRectangleMode; | ||
drawFrom: (60 @ 10) to: 100 asPoint. | ||
self viewPort mirrorHorizontal. | ||
self backend clickAt: 50 asPoint. | ||
self compareBackendFormWith: #mirroredRectangleHorizontal |
12 changes: 12 additions & 0 deletions
12
...ests.package/M2DrawingComponentTests.class/instance/testFormAfterRectangleVerticalFlip.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,12 @@ | ||
testing | ||
testFormAfterRectangleVerticalFlip | ||
self | ||
contextFillGeometricModeWithForm: #ellipse; | ||
drawFrom: (40 @ 10) to: (80 @ 90). | ||
self backend clickAt: 50 asPoint. | ||
self | ||
contextSelectionRectangleMode; | ||
drawFrom: 30 asPoint to: 100 asPoint. | ||
self viewPort mirrorVertical. | ||
self backend clickAt: 50 asPoint. | ||
self compareBackendFormWith: #mirroredRectangleVertical |
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-Tools.package/M2EllipseShape.class/instance/getMirrorPos.For..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 @@ | ||
mirroring | ||
getMirrorPos: aBoundary For: aSymbol | ||
^ aBoundary topLeft + (1 @ 1) |
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
7 changes: 7 additions & 0 deletions
7
packages/SketchMorph2-Tools.package/M2GeometricShape.class/instance/getMirrorPos.For..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 @@ | ||
mirroring | ||
getMirrorPos: aBoundary For: aSymbol | ||
| pos| | ||
aSymbol = #horizontal | ||
ifTrue: [pos:= aBoundary topRight] | ||
ifFalse: [pos := aBoundary bottomLeft]. | ||
^ pos |
3 changes: 3 additions & 0 deletions
3
packages/SketchMorph2-Tools.package/M2GeometricShape.class/instance/mirrorByAxis..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 @@ | ||
mirroring | ||
mirrorByAxis: aSymbol | ||
^ self |
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-Tools.package/M2LassoShape.class/instance/mirrorByAxis..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 @@ | ||
mirroring | ||
mirrorByAxis: aSymbol | ||
aSymbol = #horizontal ifTrue: [self morph flipHAroundX: nil] ifFalse: [self morph flipVAroundY: nil] |
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-Tools.package/M2RectangleShape.class/instance/getMirrorPos.For..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 @@ | ||
mirroring | ||
getMirrorPos: aBoundary For: aSymbol | ||
^ aBoundary topLeft + (1 @ 1) |
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
7 changes: 7 additions & 0 deletions
7
packages/SketchMorph2-Tools.package/M2SelectTool.class/instance/cutSelection.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 @@ | ||
mirroring | ||
cutSelection | ||
| form| | ||
form := self backend activeForm contentsOfArea: self bounds. | ||
form := self clip: form. | ||
self backend project: self getMask at: self bounds topLeft rule: Form rgbMul. | ||
^ form |
9 changes: 9 additions & 0 deletions
9
packages/SketchMorph2-Tools.package/M2SelectTool.class/instance/getMask.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 @@ | ||
accessing | ||
getMask | ||
|mask| | ||
mask := self mask. | ||
mask replaceColor: Color white withColor: Color black. | ||
mask replaceColor: Color transparent withColor: Color white. | ||
mask replaceColor: Color black withColor: Color transparent. | ||
|
||
^ mask |
Oops, something went wrong.