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

Fix delete drawing tool to respect the selected layer #4263

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Aug 25, 2023

Identify the Bug or Feature request

Fixes #4258

Description of the Change

The bug fix is to remove DeleteDrawingTool's selectedLayer field (which is never changed from the Token layer), and instead rely on DefaultTool.getSelectedLayer() when the layer is needed.

There is also a bit of related refactoring to make DefaultTool.getSelectedLayer() the only place we obtain the current layer for drawing tools, and so the LayerSelectionDialog also does not have to figure that out itself.

Possible Drawbacks

Should be none.

Documentation Notes

N/A

Release Notes

  • Fixed a bug where the delete drawing tool only affected drawings on the token layer.

This change is Reviewable

Rather than `DeleteDrawingTool` rolling its own layer selection, we now use the selection provided by `DefaultTool`.
`PointerTool` and `AbstractDrawingTool` now use the layer selection from `DefaultTool` rather than reaching out to the
zone renderer directly. To support this, the `DefaultTool` now updates its selected layer when attaching to the
renderer.
Instead of the dialog having to discover the current renderer, we now have the tools directly set the layer it should
present as selected. This removes an unnecessary assumption in `LayerSelectionDialog` while also making it clear in
`DefaultTool` that the dialog is being updated to use the same layer expected by the tool.
@kwvanderlinde kwvanderlinde force-pushed the bugfix/4258-delete-drawing-tool-does-not-respect-selected-layer branch from c61a93b to 233a092 Compare August 25, 2023 18:57
@cwisniew cwisniew added this pull request to the merge queue Aug 26, 2023
Merged via the queue into RPTools:develop with commit 39a3f65 Aug 26, 2023
4 checks passed
@kwvanderlinde kwvanderlinde deleted the bugfix/4258-delete-drawing-tool-does-not-respect-selected-layer branch August 31, 2023 02:41
@cwisniew cwisniew added the bug label Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

[Bug]: Delete drawing tool can only delete drawings on the Token layer
2 participants