#UI_ENHANCEMENT by cg
class: Image
changed:
#drawEllipse:withValue:lineWidth:
#fillAntiAliasedArc:radius:from:angle:withColor:colorDictionary:blendStart:
#fillArc:radius:from:angle:withColor:
#fillEllipse:withValue:
care for no display; give a better error message then
--- a/Image.st Mon Nov 20 20:11:24 2017 +0100
+++ b/Image.st Tue Nov 21 16:28:57 2017 +0100
@@ -9901,14 +9901,18 @@
yI "{ Class: SmallInteger }"
wI "{ Class: SmallInteger }"
hI "{ Class: SmallInteger }"
- tempImage lw|
+ tempImage lw display|
+
+ (display := Screen current) isNil ifTrue:[
+ self error:'No display - cannot draw ellipse'
+ ].
lw := lineWidthOrNil ? 1.
wI := aRectangle width.
hI := aRectangle height.
- tempForm := Form width:wI+lw height:hI+lw depth:1 onDevice:Screen current.
+ tempForm := Form width:wI+lw height:hI+lw depth:1 onDevice:display.
tempForm
paint:(Color colorId:1) on:(Color colorId:0);
clear.
@@ -9946,6 +9950,7 @@
"
"Created: / 26-02-2017 / 17:13:16 / cg"
+ "Modified: / 21-11-2017 / 16:27:54 / cg"
!
drawLineFrom:startPoint to:endPoint with:aColorOrPixelValue
@@ -10171,12 +10176,16 @@
|tempForm wI "{ Class: SmallInteger }"
hI "{ Class: SmallInteger }"
- colorValue tempImage|
+ colorValue tempImage display|
+
+ (display := Screen current) isNil ifTrue:[
+ self error:'No display - cannot draw arc'
+ ].
wI := self width.
hI := self height.
- tempForm := Form width:wI height:hI depth:1 onDevice:Screen current.
+ tempForm := Form width:wI height:hI depth:1 onDevice:display.
tempForm
paint:(Color colorId:1) on:(Color colorId:0);
clear.
@@ -10218,7 +10227,7 @@
aaImgArray last inspect.
"
- "Modified (comment): / 16-02-2017 / 20:12:59 / cg"
+ "Modified: / 21-11-2017 / 16:28:05 / cg"
!
fillArc:origin radius:r from:startAngle angle:angle withColor:aColorOrIndex
@@ -10228,12 +10237,16 @@
|tempForm tempImage
wI "{ Class: SmallInteger }"
hI "{ Class: SmallInteger }"
- colorValue|
-
+ colorValue display|
+
+ (display := Screen current) isNil ifTrue:[
+ self error:'No display - cannot fill arc'
+ ].
+
wI := self width.
hI := self height.
- tempForm := Form width:wI height:hI depth:1 onDevice:Screen current.
+ tempForm := Form width:wI height:hI depth:1 onDevice:display.
tempForm
paint:(Color colorId:1) on:(Color colorId:0);
clear.
@@ -10266,7 +10279,7 @@
i inspect.
"
- "Modified (comment): / 16-02-2017 / 20:12:37 / cg"
+ "Modified: / 21-11-2017 / 16:28:15 / cg"
!
fillEllipse:aRectangle with:aColorOrPixelValue
@@ -10309,12 +10322,16 @@
|tempForm xI "{ Class: SmallInteger }"
yI "{ Class: SmallInteger }"
wI "{ Class: SmallInteger }"
- hI "{ Class: SmallInteger }" tempImage|
+ hI "{ Class: SmallInteger }" tempImage display|
+
+ (display := Screen current) isNil ifTrue:[
+ self error:'No display - cannot fill ellipse'
+ ].
wI := aRectangle width.
hI := aRectangle height.
- tempForm := Form width:wI height:hI depth:1 onDevice:Screen current.
+ tempForm := Form width:wI height:hI depth:1 onDevice:display.
tempForm
paint:(Color colorId:1) on:(Color colorId:0);
clear.
@@ -10343,7 +10360,7 @@
i inspect.
"
- "Modified (comment): / 05-09-2017 / 14:51:59 / cg"
+ "Modified: / 21-11-2017 / 16:28:25 / cg"
!
fillRectangle:aRectangle with:aColorOrPixelValue