Fix vehicle tokens in Konva 7

This commit is contained in:
Mitchell McCaffrey 2020-11-21 11:12:05 +11:00
parent c54b863330
commit 7346eced44

View File

@ -2,6 +2,7 @@ import React, { useContext, useState, useEffect, useRef } from "react";
import { Image as KonvaImage, Group } from "react-konva";
import { useSpring, animated } from "react-spring/konva";
import useImage from "use-image";
import Konva from "konva";
import useDataSource from "../../helpers/useDataSource";
import useDebounce from "../../helpers/useDebounce";
@ -16,6 +17,9 @@ import TokenLabel from "../token/TokenLabel";
import { tokenSources, unknownSource } from "../../tokens";
// Enable hit detection on drag to allow for vehicle tokens
Konva.hitOnDragEnabled = true;
const snappingThreshold = 1 / 7;
function MapToken({