godotengine / godotengine/godot

Expanded polygon editor closes when selecting another tile

Open
#97,828 3 comments 0 reactions 0 assignees View on GitHub
bug topic:2d topic:editor usability
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.4 db66bd3

### 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

Introduced in #95034

https://github.com/user-attachments/assets/71cce4ef-c388-4829-bcd7-6d29d12110df

Technically it's not a regression, because it fixed a worse issue, but it can still be improved.

More info from the PR:
> TileSet editor has an internal inspector that really likes getting refreshed. One instance is when you select another tile, another is when a polygon is added or removed:

https://github.com/godotengine/godot/blob/3978628c6cc1227250fc6ed45c8d854d24c30c30/scene/resources/2d/tile_set.cpp#L6271

> This causes all property editors to get destroyed and re-created.
There is one special editor though - the expanded editor. When you expand polygon editor (see https://github.com/godotengine/godot/pull/79512), it's moved to a different parent that isn't inside the inspector. So when inspector is cleared, the expanded editor survives it and holds outdated information.

> I don't have a good solution for that yet. Perfectly, when inspector is refreshed, the previous editor should be automatically expanded again. However the "previous" editor no longer exists and there can be multiple polygon editors, so it has to be somehow remembered per-property, idk.

### Steps to reproduce

1. Edit TileSet
2. Edit some tile's polygon
3. Expand the editor
4. Select another tile

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Research direction

Start in scene/resources/2d/tile_set.cpp around line 6271 and review the expanded polygon editor introduced by PR #79512, along with the behavior described in #95034. Reproduce the steps in the TileSet editor: after expanding a polygon editor, selecting another tile should not leave the expanded editor showing outdated information or close unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.