godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.23k stars 21.22k forks source link

Editor canvas tool lines inaccurate and offset. #41989

Open ghost opened 4 years ago

ghost commented 4 years ago

Godot version:

d38eb29f2e713b65a214e3fcdee7e8375c9fc493

OS/device including version:

Win10 64-bit

Issue description:

The editors lines in some situations can be offset, when they should follow the border of the rendered content.

godot windows tools 64_TaglOJvQ0k

Steps to reproduce: Not entirely sure what happened. Was making some dummy controls for tests. I switched to snapping, and then noticed the boundary lines of this GUI button and it's child Polygon2D are not where its actually rendered. Seems to be caused by the Button and passed down to the Polygon2D.

Minimal reproduction project:

Editor Line Issue.zip

Calinou commented 4 years ago

Does this bug occur in 3.2.x?

ghost commented 4 years ago

Yes.

capnm commented 4 years ago

You somehow managed that the position / size of the button is in partial pixels, that causes this issue.

grafik

grafik

Calinou commented 3 years ago

This may happen because Control lines are snapped to pixels whereas Node2Ds aren't snapped to pixels unless Pixel Snap is enabled.

Since both of these values are global project settings, if this is the cause of the bug, then we can't fix it in the editor without introducing undesirable side effects. Disabling Snap Controls to Pixels will make UI elements look less crisp.