wsaunders1014 / ShowDragDistance

Shows distance you dragged the token, similar to pressing ctrl.
10 stars 13 forks source link

Dash measurement not working with the metric system and decimals #26

Closed mech-tools closed 4 years ago

mech-tools commented 4 years ago

Hello,

With the metric system, characters can have a speed with decimals(e.g: 1.5 m, 7.5 m, etc.) The dash measurement doesn't work in that case.

Here is a token with a movement speed of 9 m. This is working great: Capture d’écran 2020-09-10 à 12 51 52

And here is a token with a movement speed of 7.5 m. As you can see on the screenshot, the dash measurement is one square short: Capture d’écran 2020-09-10 à 12 52 12

wsaunders1014 commented 4 years ago

I'm not sure the module will work with decimals. you can't split the highlight on a square. What's your grid set too?

mech-tools commented 4 years ago

@wsaunders1014 grid is set to 1.5 m I don't split squares. All movements are multipliers of 1.5.

9 = 6 1.5 7.5 = 5 1.5

mech-tools commented 4 years ago

@wsaunders1014 https://github.com/wsaunders1014/ShowDragDistance/blob/master/showdragdistance.js#L34 parseFloat instead of parseInt?

wsaunders1014 commented 4 years ago

You can change the parseInt to parseFloat in the code and see if that helps. I will investigate further when I can

On Thu, Sep 10, 2020 at 4:47 PM DarKDinDoN notifications@github.com wrote:

@wsaunders1014 https://github.com/wsaunders1014 grid is set to 1.5 m

I don't split squares. All movement multipliers of 1.5.

9 = 6 * 1.5

7 = 5 * 1.5

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wsaunders1014/ShowDragDistance/issues/26#issuecomment-690717680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2RA5JFKQCKZCZJCHEFI53SFE3MRANCNFSM4REZDYYA .

-- Will Saunders Front End Developer IAmWillSaunders.com

mech-tools commented 4 years ago

@wsaunders1014 Made the change on both lines:

And I confirm it works great

wsaunders1014 commented 4 years ago

Nice, I’ll add it to the next update

On Thu, Sep 10, 2020 at 5:03 PM DarKDinDoN notifications@github.com wrote:

@wsaunders1014 https://github.com/wsaunders1014

Made the change on both lines:

- https://github.com/wsaunders1014/ShowDragDistance/blob/master/showdragdistance.js#L34

- https://github.com/wsaunders1014/ShowDragDistance/blob/master/showdragdistance.js#L36

And I confirm it works great

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wsaunders1014/ShowDragDistance/issues/26#issuecomment-690729633, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2RA5KLZKCKXWSTJURH4GLSFE5KRANCNFSM4REZDYYA .

-- Will Saunders Front End Developer IAmWillSaunders.com

wsaunders1014 commented 4 years ago

2.1.2 is not out with this change.