--- a/ImageEditView.st Wed Feb 15 22:32:09 2012 +0100
+++ b/ImageEditView.st Thu Feb 16 08:45:39 2012 +0100
@@ -371,6 +371,12 @@
self modified:true
!
+spraySpot
+ ^ spraySpot
+
+ "Created: / 15-02-2012 / 22:38:04 / cg"
+!
+
spraySpot:something
spraySpot := something.
!
@@ -662,7 +668,7 @@
x := p x + sprayPoint x truncated.
y := p y + sprayPoint y truncated.
- self pointAt:(x@y).
+ self pointAt:(x@y) width:1.
].
].
dly wait.
@@ -670,7 +676,7 @@
] fork.
]
- "Modified: 10.4.1997 / 15:21:24 / cg"
+ "Modified: / 15-02-2012 / 22:44:54 / cg"
!
stopSpray
@@ -1661,31 +1667,39 @@
pointAt:aPoint
"draw a single pixel with the currently selected color"
- |w draw imagePoint clr pix|
+ self pointAt:aPoint width:self penWidth.
+
+ "Modified: / 15-02-2012 / 22:47:30 / cg"
+!
+
+pointAt:aPoint width:pw
+ "draw a single pixel with the currently selected color"
+
+ |draw imagePoint clr pix|
imagePoint := aPoint // magnification.
(imagePoint x between:0 and:image width-1) ifFalse:[^ self].
(imagePoint y between:0 and:image height-1) ifFalse:[^ self].
- draw := [:point |
- image colorMap isNil ifTrue:[
- clr := self selectedColor.
- image atImageAndMask:point put:clr.
- ] ifFalse:[
- pix := self selectedColorIndex.
- image atImageAndMask:point putValue:pix.
- ].
- self invalidate:((point * magnification extent: magnification) expandedBy:1).
- ].
+ draw :=
+ [:point |
+ image colorMap isNil ifTrue:[
+ clr := self selectedColor.
+ image atImageAndMask:point put:clr.
+ ] ifFalse:[
+ pix := self selectedColorIndex.
+ image atImageAndMask:point putValue:pix.
+ ].
+ self invalidate:((point * magnification extent: magnification) expandedBy:1).
+ ].
draw value:imagePoint.
- w := self penWidth.
- w == 1 ifTrue:[
+ pw == 1 ifTrue:[
draw value:imagePoint.
] ifFalse:[
"/ draw with a wide pen
- (w//2) negated to:(w-(w//2)) do:[:xOffs |
- (w//2) negated to:(w-(w//2)) do:[:yOffs |
+ (pw//2) negated to:(pw-(pw//2)-1) do:[:xOffs |
+ (pw//2) negated to:(pw-(pw//2)-1) do:[:yOffs |
imagePoint x + xOffs >= 0 ifTrue:[
imagePoint y + yOffs >= 0 ifTrue:[
draw value:(imagePoint + (xOffs@yOffs)).
@@ -1696,7 +1710,7 @@
].
self setModified.
- "Modified: / 02-11-2007 / 00:34:25 / cg"
+ "Created: / 15-02-2012 / 22:47:08 / cg"
!
shiftImageHorizontal:shiftH vertical:shiftV
@@ -1849,12 +1863,12 @@
0 to:image extent x - 1 do:[:x |
0 to:image extent y - 1 do:[:y |
(tempForm valueAt:(x@y)) == 1 ifTrue:[
- self pointAt:(x@y)
+ self pointAt:(x@y) width:1
].
]
].
- "Modified: / 11-11-2007 / 12:06:33 / cg"
+ "Modified: / 15-02-2012 / 22:47:44 / cg"
!
undo
@@ -2268,9 +2282,13 @@
resourceClass := resourceSelector := nil.
drawingColorHolders := Array with:(nil asValue) with:(nil asValue). "/ left/right mouse colors
drawingPixelHolders := Array with:(nil asValue) with:(nil asValue). "/ left/right mouse colors
+
+ spraySpot := 8.
+ penWidth := 1.
+
self editMode:EditModePoint.
- "Modified: / 03-05-2011 / 12:24:28 / cg"
+ "Modified: / 15-02-2012 / 22:39:22 / cg"
! !
!ImageEditView methodsFor:'loading & saving'!
@@ -2739,11 +2757,11 @@
!ImageEditView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.247 2011-05-03 10:28:30 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.248 2012-02-16 07:45:39 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.247 2011-05-03 10:28:30 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.248 2012-02-16 07:45:39 cg Exp $'
! !
ImageEditView initialize!