#TUNING by cg
class: ArrowButton
changed: #drawWith:and:
draw by sending messages to gc instead of self.
(new GC structure)
--- a/ArrowButton.st Tue Jan 24 14:10:14 2017 +0100
+++ b/ArrowButton.st Tue Jan 24 22:58:34 2017 +0100
@@ -954,8 +954,8 @@
cache the result for later drawing operations.
"
logo notNil ifTrue:[
- self paint:bg.
- self fillRectangleX:0 y:0 width:width height:height.
+ gc paint:bg.
+ gc fillRectangleX:0 y:0 width:width height:height.
shadowColor := shadowColor onDevice:device.
lightColor := lightColor onDevice:device.
@@ -1002,7 +1002,7 @@
orgX := (width - labelOriginX) // 4 - 1.
].
- self paint:topLeft.
+ gc paint:topLeft.
#(-1 0 -1) with:#(-1 -1 0) do:[:dX :dY |
|x y|
@@ -1010,13 +1010,13 @@
y := orgY + dY.
isString ifTrue:[
- self displayString:logo x:x y:y.
+ gc displayString:logo x:x y:y.
] ifFalse:[
- self displayForm:logo x:x y:y.
+ gc displayForm:logo x:x y:y.
]
].
- self paint:botRight.
+ gc paint:botRight.
#(1 1 0) with:#(0 1 1) do:[:dX :dY |
|x y|
@@ -1024,20 +1024,20 @@
y := orgY + dY.
isString ifTrue:[
- self displayString:logo x:x y:y.
+ gc displayString:logo x:x y:y.
] ifFalse:[
- self displayForm:logo x:x y:y.
+ gc displayForm:logo x:x y:y.
]
].
"
finally, the form itself
"
- self paint:fg.
+ gc paint:fg.
isString ifTrue:[
- self displayString:logo x:orgX y:orgY.
+ gc displayString:logo x:orgX y:orgY.
] ifFalse:[
- self displayForm:logo x:orgX y:orgY.
+ gc displayForm:logo x:orgX y:orgY.
]
]