Skip to content

[Bug]: Token selection cleared the first time switching to a tool #5990

Description

@kwvanderlinde

Describe the Bug

If a token is selected using the Pointer Tool, then the user switches to a different tool, the token selection is cleared. This only happens the first time the users switches to that particular tool, at least since that last time they switched layers. I.e., repeating the process with the same tool will not clear the token selection, but switching to a different tool will clear the token selection. Changing layers seems to reset everything.

To Reproduce

  1. Open a fresh instance of MapTool
  2. Drop a token on the map and make sure it is selected.
  3. Click the "Measure distance along path" tool
    • Notice the token gets deselected.
  4. Switch back to the "Pointer Tool" and select the token again.
  5. Once again select the "Measure distance along path" tool
    • Notice the token is not deselected
  6. Now select "Drawing Tools" (should switch to the "Delete drawing tool")
    • Notice the token is deselected this time.
  7. Now switch layers and drop a new token, repeating the above steps.
    • The same sort of behaviour should be observed.
  8. Switch back to the original layer, and repeat the above steps.
    • Note that we're back to each tool clearing the selection at first.

Expected Behaviour

We should always maintain the token selection. At least some tools need this to work properly, e.g., Fog of War tools for Individual FoW support.

We might not always want to render the selection border for tokens depending on the selected tool. E.g., now that drawings have their own selections, maybe it would be confusing to see the token selection border with the Drawing Tools open. But the token selection itself should be left intact.

Screenshots

No response

MapTool Info

1.18.6

Desktop

Linux Mint 22.3

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions