[Cuis-dev] TextModelMorph horizontal scrolling isses
Bernhard Pieber
bernhard at pieber.com
Sun Feb 4 10:31:40 PST 2024
Hi folks,
I played around with TextModelMorph and noted some minor issues.
If I do the following:
(TextModelMorph withText: 'This is a long long long line.')
wrapFlag: false;
openInWorld.
1. The morph opens with a horizontal scrollbar as expected. If I click after the first long and enter carriage return in order to split the line into two short lines I expect the horizontal scrollbar to disappear. However, it is unchanged.
The reason seems to be that the InnerTextMorph width is not reduced. I tried calling adjustExtent and fit. However, this does not reduce the width. The reason for that is that TextComposition maxRightX is not updated. InnerTextMorph>>#resetTextComposition does the trick. However, I am not sure if calling this is the right fix compared to somehow fixing TextComposition>>#recomposeFrom:to:delta:.
2. If I add a new line and type an even longer line the horizontal scroll bar’s width gets smaller as expected. However, the text I enter is not scrolled into view. The method PluggableScrollPane>>#scrollToShow: seems to only do vertical scrolling but not horizontal scrolling.
The attached changeset seems to fix the second issue.
Cheers,
Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 6204-FixHorizontalScrolling-BernhardPieber-2024Feb04-18h16m-bp.001.cs.st
Type: application/octet-stream
Size: 3205 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240204/9acf7e1e/attachment.obj>
More information about the Cuis-dev
mailing list