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);
}
mapStage.on("mousedown", handleBrushDown);
mapStage.on("mousemove", handleBrushMove);
mapStage.on("mouseup", handleBrushUp);
mapStage.on("mousedown touchstart", handleBrushDown);
mapStage.on("mousemove touchmove", handleBrushMove);
mapStage.on("mouseup touchend", handleBrushUp);
return () => {
mapStage.off("mousedown", handleBrushDown);
mapStage.off("mousemove", handleBrushMove);
mapStage.off("mouseup", handleBrushUp);
mapStage.off("mousedown touchstart", handleBrushDown);
mapStage.off("mousemove touchmove", handleBrushMove);
mapStage.off("mouseup touchend", handleBrushUp);
};
}, [
mapStageRef,

View File

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