GradientFillStyle oddity
Jesse Welton
jwelton at pacific.mps.ohio-state.edu
Fri Sep 3 19:04:05 UTC 1999
I was playing around with eliptical GradientFillStyles recently, and
found there's an oddity in the display of two octants when the axis
lies on a diagonal. This is well illustrated by the following snippet
of code:
| rect fill |
rect _ (RectangleMorph new)
extent: 200 at 200.
fill _ (GradientFillStyle ramp:
{0.0 -> (Color blue). 0.75 -> (Color red). 1.0 -> (Color yellow)}).
fill origin: rect center;
direction: 100 at 100;
normal: -50 at 50;
radial: true.
rect fillStyle: fill;
openInWorld.
One lower right octant and one upper left octant have straight
gradients, not rounded gradients. I hesitate to call this a bug
instead of an oddity, because I think perhaps the radial gradient is
intended to be used in radially symmetric situations, such as if I'd
put normal: -100 at 100 above. But I would like to use it in ovals,
since the effect can look extremely slick (especially with
translucency - woo!).
One other thing I noticed about it is that if you drag another morph a
few pixels at a time* across one of the above morphs, from left to
right, the aberrent octants are fixed a few columns of pixels at a
time. So apparently the code to render these octants correctly does
exist somewhere; it just isn't used when filling the whole region at
once. I have no idea where to look to fix this to behave as I'd like.
(* Click, drag, and release, a few pixels at a time, until you get
across the morph. It also worked to continuously drag a morph I had
created that changed itself slightly with every mouseMove.)
Any suggestions?
-Jesse
More information about the Squeak-dev
mailing list
|