#FEATURE by cg
class: ImageEditView
added:
#drawingAlpha
#drawingAlpha:
comment/format in:
#dragRectangleStartingAt:emphasis:
#drawingColors
#drawingColors:
#selectedColor
changed: #initialize
--- a/ImageEditView.st Mon Sep 04 17:12:03 2017 +0200
+++ b/ImageEditView.st Tue Sep 05 10:41:02 2017 +0200
@@ -206,6 +206,25 @@
^ Clipboard.
!
+drawingAlpha
+ "return the alpha value for drawing;
+ if the current drawing color is nil, ONLY the alpha value will be changed"
+
+ ^ drawingAlpha ? 100
+
+ "Created: / 05-09-2017 / 09:11:32 / cg"
+ "Modified: / 05-09-2017 / 10:40:25 / cg"
+!
+
+drawingAlpha:anAlphaValue
+ "set the alpha value for drawing;
+ if the current drawing color is nil, ONLY the alpha value will be changed"
+
+ drawingAlpha := anAlphaValue
+
+ "Created: / 05-09-2017 / 09:11:26 / cg"
+!
+
drawingColorHolders
drawingColorHolders isNil ifTrue:[
drawingColorHolders := Array with:(nil asValue) with:(nil asValue). "/ left/right mouse colors
@@ -216,16 +235,22 @@
!
drawingColors
+ "return the two colors in which I will draw (left / right mouse button colors)"
+
^ drawingColorHolders collect:[:each | each value].
"Modified: / 23-02-2017 / 10:17:14 / cg"
+ "Modified (comment): / 05-09-2017 / 09:12:14 / cg"
!
drawingColors:anArrayTwoColors
+ "set the two colors in which I will draw (left / right mouse button colors)"
+
(drawingColorHolders at:1) value:(anArrayTwoColors at:1).
(drawingColorHolders at:2) value:(anArrayTwoColors at:2).
"Modified: / 23-02-2017 / 10:17:21 / cg"
+ "Modified (comment): / 05-09-2017 / 09:12:07 / cg"
!
editMode
@@ -450,6 +475,7 @@
clr := (drawingColorHolders at:mouseKeyColorMode) value.
clr isNil ifTrue:[ clr := Color black ].
+
image hasAlphaChannel ifTrue:[
^ (TranslucentColor
scaledRed:clr scaledRed
@@ -460,6 +486,7 @@
^ clr
"Modified: / 23-02-2017 / 10:17:06 / cg"
+ "Modified (format): / 05-09-2017 / 09:10:35 / cg"
!
selectedColor: aColor
@@ -3016,6 +3043,7 @@
currentPoint := (0@0) max: (image extent * magnification min: (p := mp)).
currentPoint := currentPoint//magnification*magnification.
+
currentExtent := (firstPoint - currentPoint) abs.
whichQuarter := (firstPoint x - currentPoint x) > 0
ifTrue: [(firstPoint y - currentPoint y) > 0 ifTrue: ["4"1@1] ifFalse: ["3"1@0]]
@@ -3127,8 +3155,9 @@
^((0@0) max: (firstPoint min: currentPoint)) extent: (firstPoint - currentPoint) abs
- "Created: / 21.8.1998 / 20:17:07 / cg"
- "Modified: / 10.10.2001 / 14:13:08 / cg"
+ "Created: / 21-08-1998 / 20:17:07 / cg"
+ "Modified: / 10-10-2001 / 14:13:08 / cg"
+ "Modified (format): / 04-09-2017 / 18:26:06 / cg"
!
drawCursorAt:aPoint
@@ -3345,6 +3374,7 @@
].
drawingPixelHolders := Array with:(nil asValue) with:(nil asValue). "/ left/right mouse colors
+ drawingAlpha isNil ifTrue:[ drawingAlpha := 100 ].
spraySpot := 8.
penWidth := 1.
floodFillMaxHueError := floodFillMaxLightError := 0.
@@ -3352,7 +3382,7 @@
self editMode:EditModePoint.
- "Modified: / 23-02-2017 / 10:17:46 / cg"
+ "Modified: / 05-09-2017 / 10:40:54 / cg"
! !
!ImageEditView methodsFor:'loading & saving'!