[squeak-dev] [BUG] TextMorphForEditView wrapFlag

karl ramberg karlramberg at gmail.com
Sat Mar 11 14:48:28 UTC 2023


Attached is a change set that fixes turning text wrapFlag both on and off
in TextMorphForEditView.
I'm not familiar with the inner workings of these methods to say they are
the correct fixes.
The end result looks right but implementation is maybe a little clumsy.

Best,
Karl


On Sat, Mar 11, 2023 at 10:44 AM karl ramberg <karlramberg at gmail.com> wrote:

> When a you turn preference wrapFlag off in TextMorphForEditViewyou get
> Assertion failure in Morph>>#doLayoutIn:
> ...
> "2.2) Do one additional run on the layout if requested in
> #layoutInBounds:."
> (self hasProperty: #doLayoutAgain) ifTrue: [
> self removeProperty: #doLayoutAgain.
> layout flushLayoutCache.
> layout layout: self in: layoutBounds].
> self assert: (self hasProperty: #doLayoutAgain) not].
> ...
>
> But redoing the layout can add the property #doLayoutAgain.
> I think this has to be changed to :
> ...
> "2.2) Do one additional run on the layout if requested in
> #layoutInBounds:."
> (self hasProperty: #doLayoutAgain) ifTrue: [
> layout flushLayoutCache.
> layout layout: self in: layoutBounds.
> self removeProperty: #doLayoutAgain.].
> self assert: [(self hasProperty: #doLayoutAgain) not]].
> ...
>
>
> Best,
> Karl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230311/925ee509/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fix text wrapping.1.cs
Type: application/octet-stream
Size: 2505 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230311/925ee509/attachment.obj>


More information about the Squeak-dev mailing list