added rounding
This commit is contained in:
parent
dc8e9ba05f
commit
24545fc389
@ -2856,6 +2856,9 @@ function moveCardWithTokens(params)
|
|||||||
|
|
||||||
if rotation then
|
if rotation then
|
||||||
card.setRotation(rotation)
|
card.setRotation(rotation)
|
||||||
|
else
|
||||||
|
local rot = card.getRotation()
|
||||||
|
card.setRotation(rot:setAt("y", roundToMultiple(rot.y, 45)))
|
||||||
end
|
end
|
||||||
|
|
||||||
if position then
|
if position then
|
||||||
@ -2961,3 +2964,7 @@ function removeTokensFromObject(params)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function roundToMultiple(num, mult)
|
||||||
|
return math.floor((num + mult / 2) / mult) * mult
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user