mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-14 09:45:27 +01:00
no any
This commit is contained in:
@@ -39,7 +39,7 @@ import {
|
|||||||
import "./ToolIcon.scss";
|
import "./ToolIcon.scss";
|
||||||
import "./MobileToolBar.scss";
|
import "./MobileToolBar.scss";
|
||||||
|
|
||||||
import type { AppClassProperties, UIAppState } from "../types";
|
import type { AppClassProperties, ToolType, UIAppState } from "../types";
|
||||||
|
|
||||||
const SHAPE_TOOLS = [
|
const SHAPE_TOOLS = [
|
||||||
{
|
{
|
||||||
@@ -139,7 +139,7 @@ export const MobileToolBar = ({
|
|||||||
app.setActiveTool({ type: "selection" });
|
app.setActiveTool({ type: "selection" });
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
app.setActiveTool({ type: toolType as any });
|
app.setActiveTool({ type: toolType as ToolType });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -207,8 +207,10 @@ export const MobileToolBar = ({
|
|||||||
title={capitalizeString(t("toolBar.selection"))}
|
title={capitalizeString(t("toolBar.selection"))}
|
||||||
data-testid="toolbar-selection"
|
data-testid="toolbar-selection"
|
||||||
onToolChange={(type: string) => {
|
onToolChange={(type: string) => {
|
||||||
app.setActiveTool({ type: type as any });
|
if (type === "selection" || type === "lasso") {
|
||||||
app.defaultSelectionTool = type as any;
|
app.setActiveTool({ type: type });
|
||||||
|
app.defaultSelectionTool = type;
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
displayedOption={
|
displayedOption={
|
||||||
SELECTION_TOOLS.find(
|
SELECTION_TOOLS.find(
|
||||||
@@ -270,8 +272,14 @@ export const MobileToolBar = ({
|
|||||||
)}
|
)}
|
||||||
data-testid="toolbar-rectangle"
|
data-testid="toolbar-rectangle"
|
||||||
onToolChange={(type: string) => {
|
onToolChange={(type: string) => {
|
||||||
setLastActiveGenericShape(type as any);
|
if (
|
||||||
app.setActiveTool({ type: type as any });
|
type === "rectangle" ||
|
||||||
|
type === "diamond" ||
|
||||||
|
type === "ellipse"
|
||||||
|
) {
|
||||||
|
setLastActiveGenericShape(type);
|
||||||
|
app.setActiveTool({ type });
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
displayedOption={
|
displayedOption={
|
||||||
SHAPE_TOOLS.find((tool) => tool.type === lastActiveGenericShape) ||
|
SHAPE_TOOLS.find((tool) => tool.type === lastActiveGenericShape) ||
|
||||||
@@ -297,8 +305,10 @@ export const MobileToolBar = ({
|
|||||||
data-testid="toolbar-arrow"
|
data-testid="toolbar-arrow"
|
||||||
fillable={true}
|
fillable={true}
|
||||||
onToolChange={(type: string) => {
|
onToolChange={(type: string) => {
|
||||||
setLastActiveLinearElement(type as any);
|
if (type === "arrow" || type === "line") {
|
||||||
app.setActiveTool({ type: type as any });
|
setLastActiveLinearElement(type);
|
||||||
|
app.setActiveTool({ type });
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
displayedOption={
|
displayedOption={
|
||||||
LINEAR_ELEMENT_TOOLS.find(
|
LINEAR_ELEMENT_TOOLS.find(
|
||||||
|
|||||||
Reference in New Issue
Block a user