Added touch supprt to fog polygon

This commit is contained in:
Mitchell McCaffrey 2020-06-21 16:17:54 +10:00
parent 2f740efd7c
commit cb8b66e55f
2 changed files with 7 additions and 6 deletions

View File

@ -192,14 +192,14 @@ function MapFog({
setIsBrushDown(false); setIsBrushDown(false);
} }
mapStage.on("mousedown", handleBrushDown); mapStage.on("mousedown touchstart", handleBrushDown);
mapStage.on("mousemove", handleBrushMove); mapStage.on("mousemove touchmove", handleBrushMove);
mapStage.on("mouseup", handleBrushUp); mapStage.on("mouseup touchend", handleBrushUp);
return () => { return () => {
mapStage.off("mousedown", handleBrushDown); mapStage.off("mousedown touchstart", handleBrushDown);
mapStage.off("mousemove", handleBrushMove); mapStage.off("mousemove touchmove", handleBrushMove);
mapStage.off("mouseup", handleBrushUp); mapStage.off("mouseup touchend", handleBrushUp);
}; };
}, [ }, [
mapStageRef, mapStageRef,

View File

@ -124,6 +124,7 @@ export function Tick({ x, y, scale, onClick, cross }) {
onMouseEnter={handleEnter} onMouseEnter={handleEnter}
onMouseLeave={handleLeave} onMouseLeave={handleLeave}
onClick={onClick} onClick={onClick}
onTap={onClick}
> >
<Circle radius={12} fill="hsla(230, 25%, 18%, 0.8)" /> <Circle radius={12} fill="hsla(230, 25%, 18%, 0.8)" />
<Path <Path