-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Automapping creates too many undo events #2166
Comments
Applying the rules does create a single event, but when interleaved with the events you create while editing they do not merge and hence you get a lot of undo steps. The challenge is to somehow allow the automapping steps to merge with the undo commands created by the tile layer editing tools. If you find this disrupts your flow, currently the only option is to disable "Map > Automap While Drawing" and to trigger the applying of the rules manually from time to time instead. |
Ah thanks for the workaround! |
This context stores temporary data specific to applying the active AutoMappers to a target map. Previously this data was stored inside each AutoMapper and hence the rule maps had to be reloaded to be applied to a different map. Now this reloading is no longer necessary. At the same time, the context stores any new tilesets, layers and objects that may need to be added to the target map. They are no longer added directly by the AutoMapper, which avoids the need to remove unused tilesets and empty layers in a cleanup pass at the end. This change also makes progress towards using the AutoMapper as part of the preview or to be able to merge undo steps (see issue #2166), though for now that is still not possible since tile layers in the target map are still changed in-place. Finally I figured out how to make QtConcurrent::blockingMapped compile on Qt 5, making AutoMapping with Qt 5 almost twice as fast (matching the Qt 6 speed). The functor was simplified by re-using the lambda internally.
This context stores temporary data specific to applying the active AutoMappers to a target map. Previously this data was stored inside each AutoMapper and hence the rule maps had to be reloaded to be applied to a different map. Now this reloading is no longer necessary. At the same time, the context stores any new tilesets, layers and objects that may need to be added to the target map. They are no longer added directly by the AutoMapper, which avoids the need to remove unused tilesets and empty layers in a cleanup pass at the end. This change also makes progress towards using the AutoMapper as part of the preview or to be able to merge undo steps (see issue #2166), though for now that is still not possible since tile layers in the target map are still changed in-place. Finally I figured out how to make QtConcurrent::blockingMapped compile on Qt 5, making AutoMapping with Qt 5 almost twice as fast (matching the Qt 6 speed). The functor was simplified by re-using the lambda internally.
Instead, the changes are made to cloned layers and are then applied after the AutoMapping. It's not that much different from before, since these clones were already being made by the AutoMapperWrapper in order to figure out which areas were changed by the AutoMapping. Also fixed the order of any newly added layers, which was reversed since change d75e85e. Progress towards resolving #2166.
Still work in progress, since this change breaks redo for painting operations somewhere. Closes #2166
Finally, in the upcoming Tiled 1.9, "AutoMapping While Drawing" will no longer create additional undo commands! :-) Only remaining exception is when it creates or deletes objects. It's a rare case, but maybe that could be resolved later as well. |
It seems impractical that auto mapping creates undo events as if tiles were individually placed. Applying rules should create a single event.
The text was updated successfully, but these errors were encountered: