Thanks Lars and Mickael
My thought was it's a shame to only use the StyledTextRenderer.layouts cache in one direction, when block-selecting from bottom-to-top, but (mostly) not in the other direction, selecting top-to-bottom. Looking at it from a high level, doesn't seem like such a discrepancy needs to exist.
So I wondered if maybe that array could become more like a circular buffer of some kind, so that when the top of selection goes offscreen, instead of disposing the indices < 0, keep them around until that cache runs out of space. In other words, try to keep that cache full at all times. Maybe we can avoid those System.arrayCopy calls too at the top of getTextLayout() since the layouts cache seems to only grow at the edges, not in a random-access way, so instead of copying to new array we simply move the start/end pointers in the circlular buffer to "virtually" shift the indices.
Haven't fully thought this through, was just looking into it.
Thanks for any ideas/suggestions/advice, much appreciated.
Ari