morethanwords/tweb/master • 5db7cfb • 3 files, +75/-11 Center a jump on the highlighted text when th

Telegram github commits and releases

Telegram github commits and releases

@tgappsupdates

Broadcast from the most important Telegram clients' repositories

4 538 підписників
Відкрити в Telegram
morethanwords/tweb/master5db7cfb3 files, +75/-11
Center a jump on the highlighted text when the message does not fit the screen

A bubble taller than the screen cannot be centered, so fastSmoothScroll aligns
its start instead - and the search result or the quote we jumped to stays
wherever it is, several screens below: highlighted, painted and out of sight.

The scroll knows about the highlight now. When the bubble does not fit and its
start does not bring the text into view either, the text itself is centered:
findTextRect measures the match (the very ranges the highlight paints, without
painting anything), and scrollToBubble hands its offset inside the bubble to
getElementPosition and its height to fastSmoothScroll's new getElementSize -
"the part of the element that has to end up in the middle". The date group
fallback is dropped for such a scroll, it would land on the group instead of
the text, so a match taller than the screen aligns at its start, the way
tdesktop's AdjustScrollForRange does it.

Nothing moves differently when the message fits the screen, when the match is
already within its first screenful, or when there is no match to find.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

morethanwords/tweb/masterb21491c300 files, +811/-800
Build

#webk
Відкрити пост в Telegram