Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling in RichTextLabel ignores visible_characters property (fixed in master) #37720

Open
Tracked by #39144
dalexeev opened this issue Apr 9, 2020 · 4 comments
Open
Tracked by #39144
Assignees
Milestone

Comments

@dalexeev
Copy link
Member

dalexeev commented Apr 9, 2020

Godot version:
3.2.1.stable.official

OS/device including version:
Linux

Issue description:
If text does not fit in height and visible_characters is used (for the typewriter effect), then the text is not displayed as expected.

  1. scroll_active == true and scroll_following == false:
    There is an opportunity to scroll through unnecessary empty space.

  2. scroll_active == false and scroll_following == true:
    First you see empty space, then (when visible_characters is incremented by a script) you see the end of the phrase.

Proposed solution: RichTextLabel should only consider visible lines when scrolling.

Steps to reproduce:
1

Minimal reproduction project:
rtl_scroll_bug.zip

@dalexeev
Copy link
Member Author

Fixed in 4.0-dev.

@Calinou Calinou added this to the 3.5 milestone Dec 23, 2021
@Calinou Calinou changed the title Scrolling in RichTextLabel ignores visible_characters property Scrolling in RichTextLabel ignores visible_characters property (fixed in master) Dec 23, 2021
@KoBeWi KoBeWi modified the milestones: 3.5, 3.x Apr 23, 2024
@brianrodri
Copy link

brianrodri commented Aug 22, 2024

Seems this has only been fixed for VisibleCharactersBehavior.VC_CHARS_BEFORE_SHAPING.

Still seeing the same bug when using: VisibleCharactersBehavior.VC_CHARS_AFTER_SHAPING.

Minimal reproduction project (v4.3): rtl_scroll_bug.zip

@Calinou
Copy link
Member

Calinou commented Aug 23, 2024

I wonder if #78916 has any impact on this.

cc @bruvzg

@brianrodri
Copy link

Taking a look at #55636, which seems to be the fix referenced by #37720 (comment), I only see handling for VC_CHARS_BEFORE_SHAPING in the size calculation code:

for (Item *it = l.from; it && it != it_to; it = _get_next_item(it)) {
if (visible_chars_behavior == TextServer::VC_CHARS_BEFORE_SHAPING && visible_characters >= 0 && remaining_characters <= 0) {
break;
}

if (visible_chars_behavior == TextServer::VC_CHARS_BEFORE_SHAPING && visible_characters >= 0 && remaining_characters >= 0) {
tx = tx.substr(0, remaining_characters);
}

Is VC_CHARS_AFTER_SHAPING omitted intentionally here? Would appreciate some guidance on what the logic is trying to do here so I can attempt a fix!

@bruvzg bruvzg self-assigned this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants