[squeak-dev] Re: Text Morph Embedding Broken

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Jan 8 02:52:18 UTC 2014


2014/1/8 Sean P. DeNigris <sean at clipperadams.com>

> Nicolas Cellier wrote
> > Ah yes, that's true.
> > Try with Character value: 1 instead of *:
>
> Yes, that works. So is it a bug or not?
>
>
I don't know.
See the comment of Morphic-nice.695 which explains why this change was made.
The old code (lr 2006) was buggy and wrong: it did cause glitches.

For example, just insert a space between foo and the icon after opening the
morph and see how it hurts.
And note how differently weird it behaved when you replaced * with
Character value: 1...

Embedded morphs/forms created interactively will be over (Character value:
1) and work OK.
For embedded morphs/forms created programmaticaly as you did, we have to
decide something...

Another thing… There is noise around the embedded form. It seems that
> BitBltDisplayScanner>>#displayEmbeddedForm: should be changed to:
>         aForm
>                 displayOn: bitBlt destForm
>                 at: destX @ (lineY + line baseline - aForm height)
>                 clippingBox: bitBlt clipRect
>                 rule: Form blend
>                 fillColor: Color white
>
>
> Yes I saw that too.
If we change it, it should use BitBltDisplayScanner backgroundColor inst.
var. (transparent) rather than white in any case.

But I'd like to understand first.
What is strange is that old code in DisplayScanner>>placeEmbeddedObject:
did just
        anchoredMorph
            displayOn: bitBlt destForm
            at: destX - anchoredMorph width @ destY
            clippingBox: bitBlt clipRect
Exactly as the new code do in BitBltDisplayScanner>>displayEmbeddedForm:

But this was probably happening in a different order - as soon as setFont
(mutated graphics context in action).
I instrumented, and it seems that the new version is using combinationRule
37 (rgbMul) at time of Form display...
This is one rule used by StrikeFont subpixel rendering:
(SystemNavigation default browseAllCallsOn: 37) -> rgbMul ->
installStrikeFont:foregroundColor:backgroundColor:.

It might be those lines in new DisplayScanner>>displayLine:offset:leftInRun:
        stopConditionsMustBeReset
            ifTrue:[self setStopConditions].

Lazyness + stateful mutations might lead to modified side effects...


>
> -----
> Cheers,
> Sean
> --
> View this message in context:
> http://forum.world.st/Text-Morph-Embedding-Broken-tp4735055p4735059.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140108/7efb8f7d/attachment.htm


More information about the Squeak-dev mailing list