Remove int requirement from default token size

This commit is contained in:
Mitchell McCaffrey 2020-11-07 12:27:21 +11:00
parent 485c418b57
commit 68a5ae1f46
2 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ function TokenPreview({ token }) {
const gridWidth = tokenWidth;
const gridX = token.defaultSize;
const gridSize = gridWidth / gridX;
const gridY = Math.ceil(tokenHeight / gridSize);
const gridY = Math.round(tokenHeight / gridSize);
const gridHeight = gridY > 0 ? gridY * gridSize : tokenHeight;
const borderWidth = Math.max(
(Math.min(tokenWidth, gridHeight) / 200) * Math.max(1 / stageScale, 1),

View File

@ -46,7 +46,7 @@ function TokenSettings({ token, onSettingsChange }) {
name="tokenSize"
value={`${(token && token.defaultSize) || 0}`}
onChange={(e) =>
onSettingsChange("defaultSize", parseInt(e.target.value))
onSettingsChange("defaultSize", parseFloat(e.target.value))
}
disabled={tokenEmpty || token.type === "default"}
min={1}