Skip to content

Commit

Permalink
Turn M2Flip* into to tools
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Aug 2, 2022
1 parent 17a4952 commit 0b12cab
Show file tree
Hide file tree
Showing 25 changed files with 98 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
clicking
onClick: anM2DrawingContext
| tool |
tool := anM2DrawingContext
| selectTool |
selectTool := anM2DrawingContext
cachedTool: #select
ifAbsent: [^ anM2DrawingContext morphicMonet clickMenuItemWith: M2SelectRectangle label].
(tool isActive and: [tool nextStartFinishes])
ifTrue: [tool mirrorAt: self mirrorDirection]
selectTool isShapeDrawn ifTrue: [
super onClick: anM2DrawingContext.
(self tool: anM2DrawingContext) mirrorUsing: selectTool.
anM2DrawingContext activeTool: selectTool.
selectTool afterMirror]
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"class" : {
"isActivatable" : "md 7/20/2022 14:54",
"mirrorDirection" : "AG 8/1/2022 19:04",
"onClick:" : "AG 8/1/2022 19:05" },
"onClick:" : "md 8/2/2022 17:28" },
"instance" : {
} }
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"name" : "M2Flip",
"pools" : [
],
"super" : "M2IconMenuItem",
"super" : "M2ToolMenuItem",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tool
createTool
^ M2FlipHorizontalTool new
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tool
toolName
^ #flipHorizontal
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"class" : {
"createTool" : "md 8/2/2022 17:14",
"icon" : "KR 6/23/2022 13:17",
"label" : "AG 6/21/2022 12:21",
"mirrorDirection" : "AG 8/1/2022 19:04" },
"toolName" : "md 8/2/2022 17:14" },
"instance" : {
} }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tool
createTool
^ M2FlipVerticalTool new
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tool
toolName
^ #flipVertical
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"class" : {
"createTool" : "md 8/2/2022 17:15",
"icon" : "KR 6/23/2022 13:17",
"label" : "AG 6/21/2022 12:24",
"mirrorDirection" : "AG 8/1/2022 19:03" },
"toolName" : "md 8/2/2022 17:15" },
"instance" : {
} }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"mirrorDirection" : "md 8/2/2022 17:13" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "SketchMorph2-Tools",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "M2FlipHorizontalTool",
"pools" : [
],
"super" : "M2FlipTool",
"type" : "normal" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activating
activate
super activate.
self backend createUserAction
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mirroring
mirrorUsing: anM2SelectTool
anM2SelectTool mirrorAt: self mirrorDirection.
self backend finishUserAction
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"class" : {
},
"instance" : {
"activate" : "md 8/2/2022 17:09",
"mirrorDirection" : "md 8/2/2022 17:11",
"mirrorUsing:" : "md 8/2/2022 17:10" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "SketchMorph2-Tools",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "M2FlipTool",
"pools" : [
],
"super" : "M2Tool",
"type" : "normal" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"mirrorDirection" : "md 8/2/2022 17:12" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "SketchMorph2-Tools",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "M2FlipVerticalTool",
"pools" : [
],
"super" : "M2FlipTool",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mirroring
afterMirror
self
addMorphToCanvas;
nextStartFinishes: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"class" : {
},
"instance" : {
"afterMirror" : "md 8/2/2022 17:27",
"afterStop" : "md 8/2/2022 16:58",
"backendBounds" : "md 8/2/2022 12:04",
"beforeStart" : "md 8/2/2022 16:58",
Expand Down

0 comments on commit 0b12cab

Please sign in to comment.