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

Token VBL doesn't properly rotate with token when Token Layout is off-center. #1049

Closed
melek opened this issue Dec 30, 2019 · 5 comments
Closed
Assignees
Labels
bug tested This issue has been QA tested by someone other than the developer.

Comments

@melek
Copy link
Collaborator

melek commented Dec 30, 2019

Describe the bug
When a token's Layout is set off-center, generated token VBL rotates in-place instead of rotating properly with the token around the origin square.

To Reproduce
Steps to reproduce the behavior:

  1. In a new campaign, add the 'Dragon' top-down token from the Default tokens.
  2. Edit the token and in the Config tab Layout area double click the token image to reset it's size, then drag the image to the lower left corner of the layout area.
  3. Edit the token and in the VBL tab change the sensitivity to 1 and generate VBL.
  4. Close the token editor and with the token selected enter VBL mode.
  5. Hold Shift and scroll the mousewheel to rotate the token. Observe the VBL rotating in place, instead of rotating around the origin square.

Expected behavior
Token VBL should always appear correctly on the token image.

Screenshots
image
image

MapTool Info

  • Version: 1.5.8
  • Install: Upgrade from 1.5.4-rc2

Desktop (please complete the following information):

  • OS: Windows
  • Version 10

Additional context
There are some additional small bugs related to this that I'm not submitting issues for immediately, but are worth mentioning:

  • When rotating the token, I sometimes could not easily select it again by clicking on its image. I had to drag a box to select it then rotate it with the scroll wheel to get it working.
  • When the token Layout is altered, it would sometimes mis-render the token VBL preview on the token in the VBL tab of the token editor (though it appeared to be correct on the actual map)
@Phergus
Copy link
Contributor

Phergus commented Dec 31, 2019

I could have sworn there was an issue for this already but couldn't find it.

@Phergus Phergus added the bug label Dec 31, 2019
@Phergus Phergus added the up for grabs Minimal context and are well-suited for new contributors label Dec 31, 2019
@melek
Copy link
Collaborator Author

melek commented Dec 31, 2019

There was a similar issue that was closed because it couldn't be duplicated, #220 - might that be it? Though that looks more like the 1 degree bug that was fixed.

Investigating this bug using a perfectly round token (setting it to 'Top down'), the generated VBL still seems to rotate off its center, but only a tiny amount compared to the actual token image. In this screenshot, the token is perfectly centered on the corners of its parent square, but when faced 180 degrees the VBL is sitting offcenter:
image

Rooting around I think the issue is in Token.getTransformedVBL(Area), but I haven't monkeyed around enough to figure anything out.

@Merudo
Copy link
Member

Merudo commented Mar 19, 2020

The issue also occurs if the token is rotated by the setTokenFacing command.

Merudo added a commit to Merudo/maptool that referenced this issue Mar 20, 2020
- Fix token VBL not properly rotating with token when Token Layout is off-center
- Fix RPTools#1049
@Merudo
Copy link
Member

Merudo commented Mar 20, 2020

PR #1397 fixes this bug.

@Phergus Phergus removed the up for grabs Minimal context and are well-suited for new contributors label Mar 20, 2020
@Phergus
Copy link
Contributor

Phergus commented Mar 23, 2020

Tested. VBL rotates correctly now with token image.

@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Mar 30, 2020
@Phergus Phergus closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tested This issue has been QA tested by someone other than the developer.
Projects
None yet
Development

No branches or pull requests

3 participants