Merge branch 'master' into release/v1.7.0
This commit is contained in:
@@ -136,10 +136,7 @@ function MapDrawing({
|
||||
onShapeAdd(drawingShape);
|
||||
}
|
||||
|
||||
if (erasingShapes.length > 0) {
|
||||
onShapesRemove(erasingShapes.map((shape) => shape.id));
|
||||
setErasingShapes([]);
|
||||
}
|
||||
eraseHoveredShapes();
|
||||
|
||||
setDrawingShape(null);
|
||||
setIsBrushDown(false);
|
||||
@@ -164,6 +161,13 @@ function MapDrawing({
|
||||
}
|
||||
}
|
||||
|
||||
function eraseHoveredShapes() {
|
||||
if (erasingShapes.length > 0) {
|
||||
onShapesRemove(erasingShapes.map((shape) => shape.id));
|
||||
setErasingShapes([]);
|
||||
}
|
||||
}
|
||||
|
||||
function renderShape(shape) {
|
||||
const defaultProps = {
|
||||
key: shape.id,
|
||||
@@ -171,6 +175,8 @@ function MapDrawing({
|
||||
onTouchOver: () => handleShapeOver(shape, isBrushDown),
|
||||
onMouseDown: () => handleShapeOver(shape, true),
|
||||
onTouchStart: () => handleShapeOver(shape, true),
|
||||
onMouseUp: eraseHoveredShapes,
|
||||
onTouchEnd: eraseHoveredShapes,
|
||||
fill: colors[shape.color] || shape.color,
|
||||
opacity: shape.blend ? 0.5 : 1,
|
||||
id: shape.id,
|
||||
|
||||
Reference in New Issue
Block a user