@@ 103,7 103,6 @@
@preview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
@tileview [ &x1 $2 &y1 $2 &x2 $2 &y2 $2 ]
@pointer [ &x $2 &y $2 ]
-@color $1
( program )
@@ 180,35 179,18 @@ BRK
( skip ) .Mouse/state DEI #00 ! #01 JCN [ BRK ]
- ( tileview )
- .Mouse/x DEI2 DUP2 .tileview/x1 LDZ2 >> ROT ROT .tileview/x2 LDZ2 << #0101 ==
- .Mouse/y DEI2 DUP2 .tileview/y1 LDZ2 >> ROT ROT .tileview/y2 LDZ2 << #0101 ==
- #0101 == ;on-touch-tileview JCN2
-
- ( toolview )
- .Mouse/x DEI2 DUP2 .toolview/x1 LDZ2 >> ROT ROT .toolview/x2 LDZ2 << #0101 ==
- .Mouse/y DEI2 DUP2 .toolview/y1 LDZ2 >> ROT ROT .toolview/y2 LDZ2 << #0101 ==
- #0101 == ;on-touch-toolview JCN2
-
- ( dataview )
- .Mouse/x DEI2 DUP2 .dataview/x1 LDZ2 >> ROT ROT .dataview/x2 LDZ2 << #0101 ==
- .Mouse/y DEI2 DUP2 .dataview/y1 LDZ2 >> ROT ROT .dataview/y2 LDZ2 << #0101 ==
- #0101 == ;on-touch-dataview JCN2
-
- ( blendbiew )
- .Mouse/x DEI2 DUP2 .blendview/x1 LDZ2 >> ROT ROT .blendview/x2 LDZ2 << #0101 ==
- .Mouse/y DEI2 DUP2 .blendview/y1 LDZ2 >> ROT ROT .blendview/y2 LDZ2 << #0101 ==
- #0101 == ;on-touch-blendview JCN2
-
- ( colorview )
- .Mouse/x DEI2 DUP2 .colorview/x1 LDZ2 >> ROT ROT .colorview/x2 LDZ2 << #0101 ==
- .Mouse/y DEI2 DUP2 .colorview/y1 LDZ2 >> ROT ROT .colorview/y2 LDZ2 << #0101 ==
- #0101 == ;on-touch-colorview JCN2
-
- ( preview )
- .Mouse/x DEI2 DUP2 .preview/x1 LDZ2 >> ROT ROT .preview/x2 LDZ2 << #0101 ==
- .Mouse/y DEI2 DUP2 .preview/y1 LDZ2 >> ROT ROT .preview/y2 LDZ2 << #0101 ==
- #0101 == ;on-touch-preview JCN2
+ .Mouse/x DEI2 .Mouse/y DEI2 .tileview ;within-rect JSR2
+ ;on-touch-tileview JCN2
+ .Mouse/x DEI2 .Mouse/y DEI2 .toolview ;within-rect JSR2
+ ;on-touch-toolview JCN2
+ .Mouse/x DEI2 .Mouse/y DEI2 .dataview ;within-rect JSR2
+ ;on-touch-dataview JCN2
+ .Mouse/x DEI2 .Mouse/y DEI2 .blendview ;within-rect JSR2
+ ;on-touch-blendview JCN2
+ .Mouse/x DEI2 .Mouse/y DEI2 .colorview ;within-rect JSR2
+ ;on-touch-colorview JCN2
+ .Mouse/x DEI2 .Mouse/y DEI2 .preview ;within-rect JSR2
+ ;on-touch-preview JCN2
BRK
@@ 266,6 248,7 @@ BRK
&no-tool
POP
&end
+
RELEASE-MOUSE
BRK
@@ 295,9 278,11 @@ BRK
.Mouse/x DEI2 .blendview/x1 LDZ2 -- #0008 // TOB
.Mouse/y DEI2 .blendview/y1 LDZ2 -- #0008 // TOB #04 * +
.settings/blending STZ
- RELEASE-MOUSE
+
;redraw JSR2
+ RELEASE-MOUSE
+
BRK
@on-touch-colorview ( -> )
@@ 305,30 290,29 @@ BRK
.Mouse/y DEI2 .colorview/y1 LDZ2 -- #0008 // TOB
DUP #00 ! ,&no-r JCN
- .System/r ,&set-color JSR
- .System/r [ .settings/color LDZ #02 / + ] DEO
+ .System/r STHk ,&set-color JSR
+ STHr [ .settings/color LDZ #02 / + ] DEO
&no-r
DUP #01 ! ,&no-g JCN
- .System/g ,&set-color JSR
- .System/g [ .settings/color LDZ #02 / + ] DEO
+ .System/g STHk ,&set-color JSR
+ STHr [ .settings/color LDZ #02 / + ] DEO
&no-g
DUP #02 ! ,&no-b JCN
- .System/b ,&set-color JSR
- .System/b [ .settings/color LDZ #02 / + ] DEO
+ .System/b STHk ,&set-color JSR
+ STHr [ .settings/color LDZ #02 / + ] DEO
&no-b
POP
- ;redraw JSR2 BRK
+ ;redraw JSR2
+ BRK
&set-color
-
.settings/color LDZ STHk #02 / + DEI
STHr #02 MOD STHk
#0f SWP [ #40 * SFT ] AND
STHr #00 =
.Mouse/x DEI2 .colorview/x1 LDZ2 -- #0002 // TOB
SWP [ #40 * SFT ] +
-
RTN
BRK
@@ 341,10 325,10 @@ BRK
#40 SFT + #11 +
.settings/ratio STZ
- RELEASE-MOUSE
-
;redraw JSR2
+ RELEASE-MOUSE
+
BRK
@toggle-depth ( -- )
@@ 415,7 399,6 @@ RTN
;draw-colorview JSR2
;draw-dataview JSR2
;draw-preview JSR2
-
;draw-tileview JSR2
RTN
@@ 727,6 710,23 @@ RTN
RTN
+@within-rect ( x* y* rect -- flag )
+
+ STH
+ ( y < rect.y1 ) DUP2 STHkr #02 ADD LDZ2 LTH2 ,&skip JCN
+ ( y > rect.y2 ) DUP2 STHkr #06 ADD LDZ2 GTH2 ,&skip JCN
+ SWP2
+ ( x < rect.x1 ) DUP2 STHkr LDZ2 LTH2 ,&skip JCN
+ ( x > rect.x2 ) DUP2 STHkr #04 ADD LDZ2 GTH2 ,&skip JCN
+ POP2 POP2 POPr
+ #01
+RTN
+ &skip
+ POP2 POP2 POPr
+ #00
+
+RTN
+
@brush-icn 8040 e070 381c 0c00
@tool_selector 80c0 e0f0 f8e0 1000
@tool_hand 2020 20b8 7c7c 3838