--- a/Label.st Thu Jun 26 16:29:43 2008 +0200
+++ b/Label.st Sat Jun 28 13:44:58 2008 +0200
@@ -1653,7 +1653,7 @@
"redraw my label with fg/bg - this generic method is also used by subclasses
(especially Button) to redraw the logo in different colors."
- |x y scaleH scaleV nW nH hSep vSep m2 stringLogo|
+ |x y scaleH scaleV nW nH hSep vSep m2 ascent|
doClear ifTrue:[self clearInsideWith:bg].
@@ -1696,15 +1696,9 @@
y := y + 1
].
- (logo isString
- or:[logo species == String
- or:[logo isStringCollection]]) ifTrue:[
- stringLogo := true.
- y := y + (font ascentOn:device).
- ] ifFalse:[
- stringLogo := false.
- ].
-
+ ascent := logo ascentOn:self.
+ y := y + ascent.
+
adjust == #fit ifTrue:[
"/
"/ change scale to make the logo fit exactly
@@ -1716,8 +1710,8 @@
self scale:(scaleH min:scaleV).
x := transformation applyInverseScaleX:x.
- stringLogo ifTrue:[
- y := y - font ascent + (transformation applyScaleY:font ascent).
+ ascent ~~ 0 ifTrue:[
+ y := y - ascent + (transformation applyScaleY:ascent).
].
y := transformation applyInverseScaleY:y.
scaleH < scaleV ifTrue:[
@@ -1848,5 +1842,5 @@
!Label class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.136 2008-06-24 14:48:28 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Label.st,v 1.137 2008-06-28 11:44:58 stefan Exp $'
! !