Added tap events for map interaction

This commit is contained in:
Mitchell McCaffrey 2020-05-22 23:55:50 +10:00
parent 5f2d282df8
commit a91f2c6d39
3 changed files with 3 additions and 0 deletions

View File

@ -191,6 +191,7 @@ function MapDrawing({
onMouseOver: (e) => handleShapeMouseOver(e, shape),
onMouseOut: (e) => handleShapeMouseOut(e, shape),
onClick: (e) => handleShapeClick(e, shape),
onTap: (e) => handleShapeClick(e, shape),
fill: colors[shape.color] || shape.color,
opacity: shape.blend ? 0.5 : 1,
};

View File

@ -187,6 +187,7 @@ function MapFog({
onMouseOver={(e) => handleShapeMouseOver(e, shape)}
onMouseOut={(e) => handleShapeMouseOut(e, shape)}
onClick={(e) => handleShapeClick(e, shape)}
onTap={(e) => handleShapeClick(e, shape)}
points={shape.data.points.reduce(
(acc, point) => [...acc, point.x * mapWidth, point.y * mapHeight],
[]

View File

@ -205,6 +205,7 @@ function MapToken({
onTouchStart={handlePointerDown}
onTouchEnd={handlePointerUp}
onClick={handleClick}
onTap={handleClick}
onDragEnd={handleDragEnd}
onDragStart={handleDragStart}
opacity={tokenOpacity}