--- a/GradientBackground.st Sun Jan 23 10:44:49 2011 +0100
+++ b/GradientBackground.st Sun Jan 23 12:53:48 2011 +0100
@@ -65,7 +65,9 @@
fillRectangleX:x y:y width:w height:h in:aView
"this is a first (very inefficient) try"
- |r1 r2 g1 g2 b1 b2 dR r dG g dB b xRight rC gC bC lastR lastG lastB|
+ |hAll r1 r2 g1 g2 b1 b2 dR r dG g dB b xRight rC gC bC lastR lastG lastB|
+
+ hAll := 1000. "/ aView height.
r1 := color1 redByte.
r2 := color2 redByte.
@@ -77,11 +79,11 @@
direction = #horizontal ifTrue:[
self halt
] ifFalse:[
- dR := (r2 - r1) / (aView height).
+ dR := (r2 - r1) / hAll.
r := r1 + (dR * y).
- dG := (g2 - g1) / (aView height).
+ dG := (g2 - g1) / hAll.
g := g1 + (dG * y).
- dB := (b2 - b1) / (aView height).
+ dB := (b2 - b1) / hAll.
b := b1 + (dB * y).
xRight := x+w-1.
@@ -101,10 +103,11 @@
]
"Created: / 23-01-2011 / 01:59:29 / cg"
+ "Modified: / 23-01-2011 / 12:53:36 / cg"
! !
!GradientBackground class methodsFor:'documentation'!
version_CVS
- ^ '$Header: /cvs/stx/stx/libview/GradientBackground.st,v 1.2 2011-01-23 01:45:47 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/GradientBackground.st,v 1.3 2011-01-23 11:53:48 cg Exp $'
! !