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

2D selecting ignores z_index #96576

Open
KoBeWi opened this issue Sep 4, 2024 · 3 comments · May be fixed by #96584
Open

2D selecting ignores z_index #96576

KoBeWi opened this issue Sep 4, 2024 · 3 comments · May be fixed by #96584

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Sep 4, 2024

Tested versions

4.3
4.2.2

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

If lower node z-index wise is lower in tree, it will be selected through the top node:

Godot_v4.2.2-stable_win64_MZVOF1ZM12.mp4

Steps to reproduce

  1. Add 2 Sprite2Ds
  2. Make them overlay
  3. Change z-index so that sprite further in tree appears below (contrary to default drawing order)
  4. Click intersection point

Minimal reproduction project (MRP)

N/A

@bikemurt
Copy link
Contributor

bikemurt commented Sep 5, 2024

2024-09-04.20-19-16.mp4

I think this should fix it for single clicking. I didn't look into group selections or anything like that, but I'm not sure that's relevant with z-index issues.

@kleonc
Copy link
Member

kleonc commented Sep 5, 2024

2D selecting ignores z_index

It ignores rendering order in general. So all properties like show_behind_parent, top_level, y_sort_enabled are not taken into account as well. Same about containing canvas layers.

For all of them it's as trivial to create an example of "wrong selection" as for z_index.

Also note that z_index is considered separately for each rendering canvas; meaning a canvas item with greater z_index can still be drawn behind a canvas item with lower z_index (if they belong to different canvases, e.g. different CanvasLayer nodes).

@KoBeWi
Copy link
Member Author

KoBeWi commented Sep 5, 2024

Well my original problem was with TileMapLayer. I have a foreground layer and background layer and the back layer was being selected over the front one. It's rather annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants