#TUNING by cg
class: ProgressIndicator
changed: #redraw
draw by sending messages to gc instead of self.
(new GC structure)
--- a/ProgressIndicator.st Tue Jan 24 23:14:15 2017 +0100
+++ b/ProgressIndicator.st Tue Jan 24 23:15:21 2017 +0100
@@ -1079,23 +1079,23 @@
].
doBusy ifTrue:[
- self paint:bgColor.
- self fillRectangleX:m y:m width:w height:h.
+ gc paint:bgColor.
+ gc fillRectangleX:m y:m width:w height:h.
lx := (w * busyPosition / 100) rounded.
rx := (w * (busyPosition + 20) / 100) rounded.
rx := rx min:w.
lx := lx max:m.
- self paint:fgColor.
- self fillRectangleX:lx y:m width:(rx - lx) height:h.
+ gc paint:fgColor.
+ gc fillRectangleX:lx y:m width:(rx - lx) height:h.
^ self
].
self stopBusyIndicationProcess.
rx := (w * percentage / 100) rounded.
- self paint:bgColor.
- self fillRectangleX:m+rx y:m width:w-rx height:h.
+ gc paint:bgColor.
+ gc fillRectangleX:m+rx y:m width:w-rx height:h.
(reallyShowPercentage := showPercentage) ifTrue:[
s := percentage printString , ' %'.
@@ -1108,22 +1108,22 @@
sy := height // 2 + deviceFont descent + 2.
rx <= (sx+sw) ifTrue:[
- self paint:self blackColor.
- self displayString:s x:sx y:sy.
+ gc paint:self blackColor.
+ gc displayString:s x:sx y:sy.
]
]
].
- self paint:fgColor.
- self fillRectangleX:m y:m width:rx height:h.
+ gc paint:fgColor.
+ gc fillRectangleX:m y:m width:rx height:h.
reallyShowPercentage ifTrue:[
rx >= sx ifTrue:[
oldClip := self clippingBoundsOrNil.
self clippingBounds:(m@m corner:rx+1 @ h).
- self paint:(fgColor contrastingBlackOrWhite).
- self displayString:s x:sx y:sy.
+ gc paint:(fgColor contrastingBlackOrWhite).
+ gc displayString:s x:sx y:sy.
self clippingBounds:oldClip
]
]