translucent and transparent in B3d
Bert Freudenberg
bert at isg.cs.uni-magdeburg.de
Tue Aug 12 19:29:02 UTC 2003
Martin Kuball wrote:
> Am Montag, 11. August 2003 20:25 schrieben Sie:
>
>>Martin Kuball wrote:
>>
>>>Hi!
>>>
>>>In B3DSceneMorph>>renderOn: the color of the morph is checked for
>>>translucency:
>>>
>>> (color isTransparent or: [color isTranslucent])
>>> ifTrue: [myRenderer restoreMorphicBackground: self bounds under: self].
>>>
>>>If I understand this, translucency includes transparency. So the explicit
>>>test for the latter is not necessary, isn't it?
>>>
>>>Som lines later:
>>>
>>> color isTransparent
>>> ifFalse:[myRenderer clearViewport: color].
>>>
>>>Should't this be "color isTranslucent" here?
>>
>>No. If the color is not transparent, the viewport must be filled with
>>the translucent color to get the "tint" effect.
>
>
> OK, agreed. But I'm right on the first one, am I?
Almost. The latter is necessary while the former is not.
However, this is "intention-revealing" code. If there was only a test
for translucency at the top and a test for transparency below, I'm sure
the next guy like you would argue about it ;-)
-- Bert
More information about the Squeak-dev
mailing list
|