#REFACTORING
class: XftFontDescription
changed: #displayString:from:to:x:y:in:opaque:
--- a/XftFontDescription.st Fri Nov 13 21:02:00 2015 +0100
+++ b/XftFontDescription.st Fri Nov 13 21:04:14 2015 +0100
@@ -647,17 +647,16 @@
drawY := drawPnt y ceiling.
].
- fg := aGC paint.
- fgPixel := fg colorId.
- "/ fgPixel notNil ifTrue:[
- fgR := fg scaledRed.
- fgG := fg scaledGreen.
- fgB := fg scaledBlue.
- fgA := (fg alpha * 65535) rounded.
- "/].
+ fg := aGC paint.
+ fgR := fg scaledRed.
+ fgG := fg scaledGreen.
+ fgB := fg scaledBlue.
+ fgA := fg scaledAlpha.
+
fgR isNil ifTrue:[
"/ when drawing into a pixmap...
- fg colorId == 0 ifTrue:[
+ fgPixel := fg colorId.
+ fgPixel == 0 ifTrue:[
fgR := fgG := fgB := 0.
] ifFalse:[
fgR := fgG := fgB := 16rFFFF.
@@ -665,15 +664,12 @@
].
opaque ifTrue:[
- bg := aGC backgroundPaint.
+ bg := aGC backgroundPaint.
bg isColor ifTrue:[
- bgPixel := bg colorId.
- "/bgPixel notNil ifTrue:[
- bgR := bg scaledRed.
- bgG := bg scaledGreen.
- bgB := bg scaledBlue.
- bgA := (bg alpha * 65535) rounded.
- "/].
+ bgR := bg scaledRed.
+ bgG := bg scaledGreen.
+ bgB := bg scaledBlue.
+ bgA := bg scaledAlpha.
] ifFalse:[
"images are not yet implemented"
"/ #todo: fill background rectangle
@@ -681,7 +677,8 @@
].
bgR isNil ifTrue:[
"/ when drawing into a pixmap...
- bg colorId == 0 ifTrue:[
+ bgPixel := bg colorId.
+ bgPixel == 0 ifTrue:[
bgR := bgG := bgB := 0.
] ifFalse:[
bgR := bgG := bgB := 16rFFFF.
@@ -749,12 +746,11 @@
if (bgPixel != nil) {
color.pixel = (unsigned long)__intVal(bgPixel);
}
- // else {
- color.color.red = __intVal(bgR);
- color.color.green = __intVal(bgG);
- color.color.blue = __intVal(bgB);
- color.color.alpha = __intVal(bgA);
- // }
+ color.color.red = __intVal(bgR);
+ color.color.green = __intVal(bgG);
+ color.color.blue = __intVal(bgB);
+ color.color.alpha = __intVal(bgA);
+
switch (__bytesPerCharacter) {
case 1:
XftTextExtents8(DISPLAY(displayId), __xftFont, (FcChar8*)string, len, &extents);
@@ -771,12 +767,11 @@
if (fgPixel != nil) {
color.pixel = (unsigned long)__intVal(fgPixel);
}
- // else {
- color.color.red = __intVal(fgR);
- color.color.green = __intVal(fgG);
- color.color.blue = __intVal(fgB);
- color.color.alpha = __intVal(fgA);
- // }
+ color.color.red = __intVal(fgR);
+ color.color.green = __intVal(fgG);
+ color.color.blue = __intVal(fgB);
+ color.color.alpha = __intVal(fgA);
+
switch (__bytesPerCharacter) {
case 1:
XftDrawString8(__sharedDrawId, &color,__xftFont,