[squeak-dev] some CharacterScanner methods weirdly send setStopConditions twice

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Sep 28 23:57:58 UTC 2013


Ah no, buildCharacterBlockIn: is used exclusively by Paragraph and thus by
MVC...
This explains why I did not understand how it could work in Morphic: it
doesn't.
We should probably unify CharacterBlockScanner response to MVC and Morphic
here.

For 1) I have identified:
characterBlockAtPoint: aPoint index: index in: textLine
...
    (text isEmpty or: [(characterPoint y < line top or: [characterPoint x <
line left])
                or: [characterIndex notNil and: [characterIndex < line
first]]])
        ifTrue:    [Beeper beep. ^ (CharacterBlock new stringIndex: line
first text: text
                    topLeft: line leftMargin at line top extent: 0 @ textStyle
lineGrid)
                    textLine: line].

The beep correlates quite well with the glitch :)

I have just posted a fix for 2)

And for 3), no idea yet...




2013/9/29 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>

> OK, I understand the  fix in CharacterBlockScanner because it is better
> explained in DisplayScanner:
> sending stopConditions will initialize alignment inst. var., which for
> some reasons wasn't set in MVC...
> Not sure that this is the right fix though... And not sure how this works
> in Morphic too...
>
> I however have found more glitches in Morphic:
> 1) if alignment is centered, you can set the blinking cursor to the left
> of the window by double clicking very near the left border.
>     Normally, the cursor should go the left of leftmost character...
>     I suspect that this could be an unset alignment defaulting to left
> flush
>     (seing all these alignment ifNil:[textStyle alignment] is a clue)
>
> 2) in case of WideString, you cannot easily select the leftmost character
> in a centered line by help of the mouse (unless you go left to window
> border).
>     I found that this is due to the leftMargin test in line from
> scanMultiCharactersFrom:...
>         nextDestX > rightX ifTrue: [destX ~= leftMargin ifTrue: [^stops
> crossedX]].
>     It did work OK when this was firstDestX, so it's me who broke it with
> Multilingual-nice.179
>     Indeed, only a MultiCompositionScanner would initialize firstDestX :=
> leftMargin, while the other scanner let it nil...
>
> 3) The blinking cursor vanishes when cursor is moved at the right of a
> right flushed line.
>     it even vanishes sooner if last char is blank (space/tab) and the
> cursor is moved with arrow key (different from mouse click!)
>
>
>
> 2013/9/29 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
>
>> Argh! case of blindness!
>> I did not find because I looked at the date and found nothing before 2006!
>>
>>
>> 2013/9/29 Bob Arning <arning315 at comcast.net>
>>
>>>  Looks like it's already there
>>>
>>> http://ftp.squeak.org/updates/updates.list
>>>
>>> Cheers,
>>> Bob
>>>
>>>  On 9/28/13 5:30 PM, Nicolas Cellier wrote:
>>>
>>>  Ah OK, I have some of these images, but first thought about browsing
>>> the web...
>>>  It would be nice if http://update.squeakfoundation.org/external/updates<http://update.squeakfoundation.org/external/updates/updates.list>were copied to
>>> http://ftp.squeak.org/updates though.
>>>
>>>
>>>
>>> 2013/9/28 Bob Arning <arning315 at comcast.net>
>>>
>>>>  Oh, I saved *lots* of them. In this case I looked at old images until
>>>> I found one containing a different version of that method. I don't know if
>>>> anyone has saved everything one one place, but if you download a lot of old
>>>> images, you might be able to find the answer (although some of them had
>>>> change sets expunged before being made available). You can get the one in
>>>> question from http://ftp.squeak.org/3.8/
>>>>
>>>> Cheers,
>>>> Bob
>>>>
>>>>   On 9/28/13 4:30 PM, Nicolas Cellier wrote:
>>>>
>>>>  Ah, thanks Bob, it seems you saved some historical bits !
>>>>
>>>>  I saw that previous timestamp was BG 5/31/2003, I found that it might
>>>> be 4717CharBlockScannerFix-slg.cs in
>>>> http://update.squeakfoundation.org/external/updates/updates.list but I
>>>> did not find any way to browse these change sets.
>>>>
>>>>  Aren't there available somewhere?
>>>>
>>>>
>>>> 2013/9/28 Bob Arning <arning315 at comcast.net>
>>>>
>>>>>  Change Set:        CenteredTextFix-BG
>>>>> Date:            31 May 2003
>>>>> Author:            Boris Gaertner
>>>>>
>>>>> In an MVC project, centered text is not displayed centered when it is
>>>>> edited. This is an attempt to fix that glitch. Please have a look at it and
>>>>> give it some testing. After all, a careless change in CharacterScanner can
>>>>> easily ruin the image.
>>>>> =======================
>>>>>
>>>>> This was when a second #setStopConditions was added preceding the
>>>>> rightMargin setting. My guess is nobody thought to remove the original
>>>>> #setStopConditions further down. Then in 2006 the new #setStopConditions
>>>>> was moved after the rightMargin setting.
>>>>>
>>>>> Cheers,
>>>>> Bob
>>>>>
>>>>>   On 9/28/13 3:51 PM, Nicolas Cellier wrote:
>>>>>
>>>>>   Sending twice some complex initialization message with inter-mixed
>>>>> state messing smells...
>>>>> This is for example in CharacterBlockScanner>>buildCharacterBlockIn:
>>>>>
>>>>>  I found http://bugs.squeak.org/view.php?id=3570 which were included
>>>>> in Graphics-ar.39
>>>>> (in 3.9 repository see
>>>>> http://source.squeak.org/39a/Graphics-ar.39.diff)...
>>>>> ...but the doubled setStopConditions was there already, the change
>>>>> just swapped some lines...
>>>>>
>>>>>  This is not in the Multilingual branch, so it seems newer than 2002...
>>>>>
>>>>>  Does anyone remember where to dig to understand why, which bug it
>>>>> solves, which feature it supports, and whether it is really needed?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130929/804529d0/attachment.htm


More information about the Squeak-dev mailing list