On Sat, Jan 28, 2023 at 8:58 PM commits@source.squeak.org wrote:
Christoph Thiede uploaded a new version of Morphic to project The Inbox: http://source.squeak.org/inbox/Morphic-ct.2082.mcz
==================== Summary ====================
Name: Morphic-ct.2082 Author: ct Time: 28 January 2023, 8:57:55.639628 pm UUID: dfcaa928-8758-5a42-a55b-2d89712a2a86 Ancestors: Morphic-mt.2081
To review: Fixes flickering in multi-column lists by ensuring sufficiently stable computation in #maxWidth.
This is likely to have a small but noticable negative impact on the performance for large lists, but I think this is inevitable if we want to avoid flickering. Otherwise, we could only consider computing the layout completely lazily during drawing.
One of the best ways to test speed impact on huge lists is to explore bits in a Form. It takes a while to process a million elements :-D [bits explore]timeToRun 89621 Best, Karl
[image: image.png]
For instance, the original bug can be reproduced by loading the SimulationMethodFinder from SimulationStudio, doing Morph new exploreProtocol and scrolling down until methodCommentAsBalloonHelp comes into view.
=============== Diff against Morphic-mt.2081 ===============
Item was changed: ----- Method: LazyListMorph>>maxWidth (in category 'layout') ----- maxWidth
"Approximate the maximum width of this lazy list. Take all visible
items as a sample.
NOTE that we MUST compute the width for all items in view!!
Otherwise, maxWidth might be instable and be increased again during drawing in #item:, causing the receiver to flicker after each #layoutChanged (e.g., from PluggableMultiColumnListMorph>>#updateColumns)."
"Approximate the maximum width of this lazy list. Take first n
items as a sample."
| listSize visibleBounds topRow bottomRow |
maxWidth ifNotNil: [^maxWidth].
| threshold listSize |
maxWidth ifNotNil:[^maxWidth].
threshold := 30. listSize := self getListSize.
visibleBounds := self bounds: self owner bounds from: self owner.
topRow := self rowAtLocation: visibleBounds topLeft.
bottomRow := self rowAtLocation: visibleBounds bottomLeft.
maxWidth := 0.
topRow to: bottomRow do: [:index |
1 to: (threshold min: listSize) do: [:index | maxWidth := maxWidth max: (self widthToDisplayItem: (self
getListItem: index))].
^ maxWidth!
^ maxWidth
- !