Added erase all back in
This commit is contained in:
@@ -63,6 +63,7 @@ function Map({
|
||||
useBlending: true,
|
||||
},
|
||||
});
|
||||
|
||||
function handleToolSettingChange(tool, change) {
|
||||
setToolSettings((prevSettings) => ({
|
||||
...prevSettings,
|
||||
@@ -73,6 +74,16 @@ function Map({
|
||||
}));
|
||||
}
|
||||
|
||||
function handleToolAction(action) {
|
||||
if (action === "eraseAll") {
|
||||
onMapDraw({
|
||||
type: "remove",
|
||||
shapeIds: mapShapes.map((s) => s.id),
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const [mapShapes, setMapShapes] = useState([]);
|
||||
function handleMapShapeAdd(shape) {
|
||||
onMapDraw({ type: "add", shapes: [shape], timestamp: Date.now() });
|
||||
@@ -82,14 +93,6 @@ function Map({
|
||||
onMapDraw({ type: "remove", shapeIds: [shapeId], timestamp: Date.now() });
|
||||
}
|
||||
|
||||
function handleShapeRemoveAll() {
|
||||
onMapDraw({
|
||||
type: "remove",
|
||||
shapeIds: mapShapes.map((s) => s.id),
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
}
|
||||
|
||||
const [fogShapes, setFogShapes] = useState([]);
|
||||
function handleFogShapeAdd(shape) {
|
||||
onFogDraw({ type: "add", shapes: [shape], timestamp: Date.now() });
|
||||
@@ -251,6 +254,7 @@ function Map({
|
||||
selectedToolId={selectedToolId}
|
||||
toolSettings={toolSettings}
|
||||
onToolSettingChange={handleToolSettingChange}
|
||||
onToolAction={handleToolAction}
|
||||
disabledControls={disabledControls}
|
||||
onUndo={onMapUndo}
|
||||
onRedo={onMapRedo}
|
||||
|
||||
Reference in New Issue
Block a user