mapeditor/tiled

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Multiple instances of Tiled can cause incorrect Snapping #3788

eishiya posted onGitHub

When using the Offset Layers tool, it always snaps to the grid, regardless of the current Snapping setting. I think this tool should respect the current Snapping option.

For now, it's possible to work around this by adjusting the Offsets directly in the Layer Properties.

Observed in 1.10.1. I suspect this is a regression, though I don't use this tool often enough to have noticed when it happened. This was reported by a user on Discord.


Hmm, I just tested this on Linux with the master branch and can't reproduce it. The current Snapping mode appears to be applied correctly when using the Offset Layers tool. Something else must be involved?

posted by bjorn over 1 year ago

Just took another look in 1.10.1 after a recent Tiled restart and could not immediately reproduce this.

However, I was able to reproduce the issue by launching a second instance of Tiled and tweaking the settings there. It seems like the most restrictive Snapping setting from among the different instances is applied to all instances. For example, if I have No Snapping in one and Fine Grid snapping in the other, both will experience Fine Grid snapping. If I have Grid snapping in one and leave Fine Grid snapping in the other, both will have Grid snapping.

Looks like this affects all snapping, not just the Offset Layers tool, it just happens that Offset Layers is where the original user noticed it, and where I tested it.

The issue persists even if the other, more restrictive, Tiled instances are closed, so it requires closing all the instances to "clear" the snapping settings for them and ensure that the remaining Tiled instance has full control over snapping.

I guess this actual issue is that snapping is global (but in a weird way!) instead of being specific to each instance. If per-instance snapping isn't possible, then I think it should at least be the most recently set setting that applies, rather than the most restrictive.

posted by eishiya over 1 year ago

The snapping is persisted to the settings as soon as you change the setting. This means the change can get reflected in another instance, as soon as it reads the value from the settings.

The menu might not reflect that latest state if it was changed in another instance, because there is no chance signal in this case.

The reason the most restrictive snapping option wins and can get stuck, is likely because it is saved as three separate bool flags (snap to grid, snap to fine grid, snap to pixel). And if one instance has turned "snap to grid" on, the menu will not have realized and will not allow you to turn it off. That does not really explain why you can't even "unstuck" it by cycling through all options, though...

posted by bjorn about 1 year ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests