#BUGFIX by stefan
class: Image
changed:5 methods
fix #drawArc:* and #fillArc:*
--- a/Image.st Wed Jul 27 21:29:04 2016 +0200
+++ b/Image.st Thu Jul 28 15:51:18 2016 +0200
@@ -9279,16 +9279,17 @@
hI := self height.
tempForm := Form width:wI height:hI depth:1 onDevice:Screen current.
- tempForm clear.
- tempForm paint:(Color colorId:1).
+ tempForm
+ paint:(Color colorId:1) on:(Color colorId:0);
+ clear.
tempForm displayArcOrigin:origin corner:corner from:startAngle angle:angle.
0 to:hI-1 do:[:yRun|
- 0 to:wI-1 do:[:xRun|
- (tempForm atX:xRun y:yRun) == 1 ifTrue:[
- self atImageAndMask:(xRun)@(yRun) putValue:aPixelValueOrNil.
- ].
- ].
+ 0 to:wI-1 do:[:xRun|
+ (tempForm atX:xRun y:yRun) == 1 ifTrue:[
+ self atImageAndMask:xRun@yRun putValue:aPixelValueOrNil.
+ ].
+ ].
].
self release. "/ device-image is no longer valid
@@ -9335,19 +9336,20 @@
hI := aRectangle height.
tempForm := Form width:wI height:hI depth:1 onDevice:Screen current.
- tempForm clear.
- tempForm paint:(Color colorId:1).
+ tempForm
+ paint:(Color colorId:1) on:(Color colorId:0);
+ clear.
tempForm displayArcIn:(0@0 extent:wI@hI) from:0 angle:360.
xI := aRectangle left.
yI := aRectangle top.
0 to:hI-1 do:[:yRun|
- 0 to:wI-1 do:[:xRun|
- (tempForm atX:xRun y:yRun) == 1 ifTrue:[
- self atImageAndMask: (xI+xRun)@(yI+yRun) putValue:aPixelValueOrNil.
- ].
- ].
+ 0 to:wI-1 do:[:xRun|
+ (tempForm atX:xRun y:yRun) == 1 ifTrue:[
+ self atImageAndMask: (xI+xRun)@(yI+yRun) putValue:aPixelValueOrNil.
+ ].
+ ].
].
self release. "/ device-image is no longer valid
@@ -9530,41 +9532,42 @@
hI := self height.
tempForm := Form width:wI height:hI depth:1 onDevice:Screen current.
- tempForm clear.
- tempForm paint:(Color colorId:1).
+ tempForm
+ paint:(Color colorId:1) on:(Color colorId:0);
+ clear.
tempForm fillArc:origin radius:r from:startAngle angle:angle.
colorValue := self valueFromColor:aColor.
0 to:hI-1 do:[:yRun|
- 0 to:wI-1 do:[:xRun|
- (tempForm atX:xRun y:yRun) == 1 ifTrue:[
- self atImageAndMask:(xRun)@(yRun) putValue:colorValue.
-
- #(#left right) do:[:aHorizontal |
- #(#top bottom) do:[:aVertical |
- self vitualAntiAliasedAlongXvertical:aVertical horizontal:aHorizontal form:tempForm color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart.
- self vitualAntiAliasedAlongYhorizontal:aHorizontal vertical:aVertical form:tempForm color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart.
- ].
- ].
- ].
- ].
- ].
-
- "
- |colorMap aaImgArray|
-
- colorMap := Array with:Color white with:Color black with:Color red with:Color blue.
-
- aaImgArray := Depth8Image extent:300@400 depth:8 antiAliasedPalette:colorMap bgColor:Color white.
- aaImgArray last fillAntiAliasedArc:205@195 radius:80 from:0 angle:90 withColor:Color red
- colorDictionary:aaImgArray first
- blendStart:aaImgArray second.
- aaImgArray last fillAntiAliasedArc:200@200 radius:80 from:90 angle:270 withColor:Color blue
- colorDictionary:aaImgArray first
- blendStart:aaImgArray second.
-
- aaImgArray last inspect.
+ 0 to:wI-1 do:[:xRun|
+ (tempForm atX:xRun y:yRun) == 1 ifTrue:[
+ self atImageAndMask:xRun@yRun putValue:colorValue.
+
+ #(#left right) do:[:aHorizontal |
+ #(#top bottom) do:[:aVertical |
+ self vitualAntiAliasedAlongXvertical:aVertical horizontal:aHorizontal form:tempForm color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart.
+ self vitualAntiAliasedAlongYhorizontal:aHorizontal vertical:aVertical form:tempForm color:aColor xRun:xRun yRun:yRun colorDictionary:colorDictionary blendStart:blendStart.
+ ].
+ ].
+ ].
+ ].
+ ].
+
+ "
+ |colorMap aaImgArray|
+
+ colorMap := Array with:Color white with:Color black with:Color red with:Color blue.
+
+ aaImgArray := Depth8Image extent:300@400 depth:8 antiAliasedPalette:colorMap bgColor:Color white.
+ aaImgArray last fillAntiAliasedArc:205@195 radius:80 from:0 angle:90 withColor:Color red
+ colorDictionary:aaImgArray first
+ blendStart:aaImgArray second.
+ aaImgArray last fillAntiAliasedArc:200@200 radius:80 from:90 angle:270 withColor:Color blue
+ colorDictionary:aaImgArray first
+ blendStart:aaImgArray second.
+
+ aaImgArray last inspect.
"
!
@@ -9580,22 +9583,23 @@
hI := self height.
tempForm := Form width:wI height:hI depth:1 onDevice:Screen current.
- tempForm clear.
- tempForm paint:(Color colorId:1).
+ tempForm
+ paint:(Color colorId:1) on:(Color colorId:0);
+ clear.
tempForm fillArc:origin radius:r from:startAngle angle:angle.
aColorOrIndex isInteger ifTrue:[
- colorValue := aColorOrIndex.
+ colorValue := aColorOrIndex.
] ifFalse:[
- colorValue := self valueFromColor:aColorOrIndex.
+ colorValue := self valueFromColor:aColorOrIndex.
].
0 to:hI-1 do:[:yRun|
- 0 to:wI-1 do:[:xRun|
- (tempForm atX:xRun y:yRun) == 1 ifTrue:[
- self atImageAndMask:(xRun)@(yRun) putValue:colorValue.
- ].
- ].
+ 0 to:wI-1 do:[:xRun|
+ (tempForm atX:xRun y:yRun) == 1 ifTrue:[
+ self atImageAndMask:xRun@yRun putValue:colorValue.
+ ].
+ ].
].
self release. "/ device-image is no longer valid
@@ -9643,19 +9647,20 @@
hI := aRectangle height.
tempForm := Form width:wI height:hI depth:1 onDevice:Screen current.
- tempForm clear.
- tempForm paint:(Color colorId:1).
+ tempForm
+ paint:(Color colorId:1) on:(Color colorId:0);
+ clear.
tempForm fillArcIn:(0@0 extent:wI@hI) from:0 angle:360.
xI := aRectangle left.
yI := aRectangle top.
0 to:hI-1 do:[:yRun|
- 0 to:wI-1 do:[:xRun|
- (tempForm atX:xRun y:yRun) == 1 ifTrue:[
- self atImageAndMask:(xI+xRun)@(yI+yRun) putValue:aPixelValueOrNil.
- ].
- ].
+ 0 to:wI-1 do:[:xRun|
+ (tempForm atX:xRun y:yRun) == 1 ifTrue:[
+ self atImageAndMask:(xI+xRun)@(yI+yRun) putValue:aPixelValueOrNil.
+ ].
+ ].
].
self release. "/ device-image is no longer valid