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

Tree control contents draw over border #39135

Open
Barugon opened this issue May 28, 2020 · 17 comments
Open

Tree control contents draw over border #39135

Barugon opened this issue May 28, 2020 · 17 comments

Comments

@Barugon
Copy link
Contributor

Barugon commented May 28, 2020

Godot version:
v3.2.1 stable

OS/device including version:
Fedora 32 (64 bit), RX 5700 XT using Navi10 driver, GLES3.

Issue description:
The contents of Tree controls draw over any border. This can be seen in the editor.

Screenshot from 2020-05-28 15-44-41

@Zylann
Copy link
Contributor

Zylann commented May 29, 2020

So does ItemList
image
image

@Calinou
Copy link
Member

Calinou commented May 29, 2020

Maybe this is intended behavior to indicate that the list overflows and can therefore be scrolled? It still looks a bit strange, so we should change it.

@Anutrix
Copy link
Contributor

Anutrix commented May 30, 2020

Related #30074.

@ewesche
Copy link

ewesche commented Jun 15, 2020

Is this still relevant? Should I fix this?

@Calinou
Copy link
Member

Calinou commented Jun 15, 2020

@ewesche I think it makes sense to fix this, so go ahead 🙂

@Barugon
Copy link
Contributor Author

Barugon commented Jun 15, 2020

Any chance of the fix getting into 3.2.2?

@Calinou
Copy link
Member

Calinou commented Jun 15, 2020

@Barugon Yes, but only if someone gets a fix merged before 3.2.2RC2 is released (probably in 1-2 weeks). Personally, I don't plan to work on this, so I'll leave it to someone else.

@Barugon
Copy link
Contributor Author

Barugon commented Dec 6, 2022

Any chance that this could get fixed for 4.0?

@Calinou
Copy link
Member

Calinou commented Dec 6, 2022

Any chance that this could get fixed for 4.0?

There is no ETA for this being fixed, as we don't know the exact cause of the issue yet. While switching the draw order by changing the order functions are called in scene/gui/tree.cpp shouldn't be too difficult, it may have side effects that will require more work to be avoided.

@Barugon
Copy link
Contributor Author

Barugon commented Dec 6, 2022

Hmm... I just played around with the Godot 4 editor and it looks like it's no longer an issue. There's even this comment in the NOTIFICATION_DRAW case of the Tree::_notification method.

@Calinou
Copy link
Member

Calinou commented Dec 6, 2022

Hmm... I just played around with the Godot 4 editor and it looks like it's no longer an issue. There's even this comment in the NOTIFICATION_DRAW case of the Tree::_notification method.

#48579 was cherry-picked for 3.4, so it's strange that this isn't fixed in 3.5.

@Barugon
Copy link
Contributor Author

Barugon commented Dec 6, 2022

Hmm... I just played around with the Godot 4 editor and it looks like it's no longer an issue. There's even this comment in the NOTIFICATION_DRAW case of the Tree::_notification method.

#48579 was cherry-picked for 3.4, so it's strange that this isn't fixed in 3.5.

Ah, highlight (focus) is good but a non-highlight border gets overwritten. Godot 4's new theme doesn't have the non-highlight border.

@Rindbee
Copy link
Contributor

Rindbee commented Aug 30, 2023

Seems to have been fixed in v4.0.stable.official[92bee43].

@Barugon
Copy link
Contributor Author

Barugon commented Aug 30, 2023

It hasn't been fixed. The borders were removed from the default theme.

@Rindbee
Copy link
Contributor

Rindbee commented Aug 31, 2023

Well, no fix, still reproducible in f7c48cf.

Peek 2023-08-31 07-46

It may be necessary to distinguish what is background and what is foreground in stylebox.

@YuriSizov
Copy link
Contributor

YuriSizov commented Aug 31, 2023

That's not something that styleboxes are responsible for. Instead, child clipping area must be controlled by the control node itself.

@Rindbee
Copy link
Contributor

Rindbee commented Oct 11, 2023

It may be possible to specify a custom clip_rect for controls with clip_contents enabled. (Also make stylebox unaffected? See #78523 and #74670)

if (ci->clip) {
if (p_canvas_clip != nullptr) {
ci->final_clip_rect = p_canvas_clip->final_clip_rect.intersection(global_rect);
} else {
ci->final_clip_rect = p_clip_rect.intersection(global_rect);
}
if (ci->final_clip_rect.size.width < 0.5 || ci->final_clip_rect.size.height < 0.5) {
// The clip rect area is 0, so don't draw the item.
return;
}
ci->final_clip_rect.position = ci->final_clip_rect.position.round();
ci->final_clip_rect.size = ci->final_clip_rect.size.round();
ci->final_clip_owner = ci;
} else {

Controls that currently have clip_contents enabled by default (usually controls that can be scrolled), have different rules for the position of the internal scroll bar.

0.mp4

control.tscn.txt

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

7 participants