Added snap to grid option to map settings

This commit is contained in:
Mitchell McCaffrey
2020-08-07 12:28:50 +10:00
parent 6b97614a60
commit 76cad29f2b
9 changed files with 52 additions and 55 deletions

View File

@@ -22,6 +22,7 @@ import {
} from "../../helpers/konva";
function MapFog({
map,
shapes,
onShapeAdd,
onShapeSubtract,
@@ -57,6 +58,7 @@ function MapFog({
function getBrushPosition() {
const mapImage = mapStage.findOne("#mapImage");
return getBrushPositionForTool(
map,
getRelativePointerPositionNormalized(mapImage),
toolId,
toolSettings,
@@ -223,23 +225,7 @@ function MapFog({
mapStage.off("mousemove touchmove", handlePolygonMove);
mapStage.off("click tap", handlePolygonClick);
};
}, [
mapStageRef,
active,
drawingShape,
editingShapes,
gridSize,
isBrushDown,
onShapeAdd,
onShapeSubtract,
onShapesEdit,
onShapesRemove,
toolId,
toolSettings,
shapes,
stageScale,
interactionEmitter,
]);
});
const finishDrawingPolygon = useCallback(() => {
const subtract = toolSettings.useFogSubtract;