[squeak-dev] BUG: UpdatingStringMorph broken in 5.3 (take 2)

karl ramberg karlramberg at gmail.com
Sun Jan 5 17:19:48 UTC 2020


We should make fitContens a bit smarter/ dumber. It should send changed
even if extent is the same

UpdatingStringMorph>>fitContents

| newExtent |
newExtent := self measureContents.
newExtent := ((newExtent x max: self minimumWidth) min: self maximumWidth)
@ newExtent y.
(self extent = newExtent) ifFalse:
[self extent: newExtent.
self changed]

Best,
Karl

On Sun, Jan 5, 2020 at 6:06 PM Stéphane Rollandin <lecteur at zogotounga.net>
wrote:

> Hello,
>
> As I already indicated one week ago, UpdatingStringMorph is currently
> broken in trunk.
>
> If you do
>
>    (UpdatingStringMorph on: Time selector: #now) openInWorld.
>
> you will see that the display is not consistently updated as it should
> via the #step method.
>
>
> This can be fixed by adding a #changed in StringMorph>>#contents: as
> follow:
>
>
> StringMorph>>#contents: newContents
>
>         newContents isText
>                 ifTrue: [^ self initializeFromText: newContents].
>
>         contents = newContents
>                 ifTrue: [^ self "no substantive change"].
>
>         contents := newContents.
>
>         self fitContents; changed
>
>
> Now maybe the #changed should be added to #fitContents itself.
>
> Stef
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200105/bb133c5a/attachment.html>


More information about the Squeak-dev mailing list