Added token rotation

This commit is contained in:
Mitchell McCaffrey
2020-05-22 21:10:05 +10:00
parent a8bd5ab672
commit ef1c875088
3 changed files with 40 additions and 11 deletions

View File

@@ -74,6 +74,11 @@ function TokenMenu({
onTokenChange({ ...tokenState, size: newSize });
}
function handleRotationChange(event) {
const newRotation = parseInt(event.target.value);
onTokenChange({ ...tokenState, rotation: newRotation });
}
function handleModalContent(node) {
if (node) {
// Focus input
@@ -192,6 +197,24 @@ function TokenMenu({
mr={1}
/>
</Flex>
<Flex sx={{ alignItems: "center" }}>
<Text
as="label"
variant="body2"
sx={{ width: "95%", fontSize: "16px" }}
p={1}
>
Rotation:
</Text>
<Slider
value={(tokenState && tokenState.rotation) || 0}
onChange={handleRotationChange}
step={45}
min={0}
max={360}
mr={1}
/>
</Flex>
</Box>
</MapMenu>
);