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

Visual content blocks that should be full size receive a scroll bar and clip text #273

Closed
mathmods opened this issue Feb 5, 2022 · 5 comments
Labels
bug Something isn't working as intended
Milestone

Comments

@mathmods
Copy link
Contributor

mathmods commented Feb 5, 2022

Describe the bug
Visual content blocks containing code receive a scroll bar and clips either top or bottom text (depending on scroll).
This scroll contains one extra empty line at the bottom (does not have any line number indicating it is an empty line).

To Reproduce

  1. Go to https://gdquest.github.io/learn-gdscript/staging/#course/lesson-13-conditions/lesson.tres
    • or any other lesson with a code block.
  2. Look at the first code block or scroll to Comparisons.

Expected behavior
Either:

  1. No scroll bar, the code block forces it's maximum size to show all content
  2. Only the largest code blocks get a scroll bar due to size, and no code blocks smaller than the forced size should have it.

Screenshots
Lesson 13 Comparisons with scroll bar at top. Clips lightly at the bottom line.
image

Lesson 13 Comparisons with scroll bar at bottom. Clips an entire line from the top.
image

Lesson 6 at the top with scroll bar at top. Clips nothing.
image

Lesson 6 at the top with scroll bar at bottom. Clips the first line and has an unnaturally large gap at the bottom.
image

Information about your device (please complete the following information):

  • Operating System: Windows 10 20H2
  • Browser: Chrome (latest release)

Additional context
Also mildly annoying when scrolling through due to them both catching the input, but also not stopping the main scroll bar when using the scroll wheel on them.

@mathmods mathmods added the bug Something isn't working as intended label Feb 5, 2022
@cogwoz
Copy link
Contributor

cogwoz commented Feb 6, 2022

The bounds of these elements seems to be slightly smaller when deployed to HTML, which makes it tricky to assess what minimum size they should be when creating them.

It could be to do with RichTextLabel heights being unreliable. I'm sure I've seen some issues relating to that.

@YuriSizov
Copy link
Contributor

RichTextLabel

Those are TextEdits though, no? And text edits do always have additional line added at the bottom, per some convention. So at least that should be accounted for.

Another issue is that those don't correctly adjust to the font size changes, which can also produce scrollbars. There seems to be at least one issue with TextEdit itself where it correctly computes, and immediately pollutes its wrapping information (see #99). If we find a reliable way for it to update with font size, I think this may also be fixed along the way.

@NathanLovato
Copy link
Contributor

Yeah the wrapping is the biggest difficulty with increasing the font size. I think we'd need some API to get the content's height, taking wrapping into account. The way we scale them now is simply increasing the UILesson's column width and I think TextEdit nodes' height proportionally to the font. But that's not always enough.

@cogwoz
Copy link
Contributor

cogwoz commented Feb 6, 2022

RichTextLabel

Those are TextEdits though, no?

Ah yes my mistake. That'll teach me to reply after just waking up.

@NathanLovato
Copy link
Contributor

For now we'll have to manually increase the code examples' minimum height. We don't have a way to calculate how tall the example should be. So when you see this issue in a specific lesson, please let us know. I fixed it for lesson 13

@NathanLovato NathanLovato added this to the 0.4 milestone Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

4 participants