mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: update eraser cursor (#4922)
* feat: update eraser cursor * fix dark theme * check before adding active class * use custom cursor instead of DOM manipulation * cache canvas and redraw only when theme changes * use oc colors * remove * cache preview data url * increase linwidth * update coords for cursor * add white 2px outline * improvements * use 1px line width 6px radius for outer * improve
This commit is contained in:
parent
6d45430344
commit
558227f744
5 changed files with 71 additions and 20 deletions
|
@ -185,11 +185,13 @@ export const ShapesSwitcher = ({
|
|||
elementType,
|
||||
setAppState,
|
||||
onImageAction,
|
||||
appState,
|
||||
}: {
|
||||
canvas: HTMLCanvasElement | null;
|
||||
elementType: AppState["elementType"];
|
||||
setAppState: React.Component<any, AppState>["setState"];
|
||||
onImageAction: (data: { pointerType: PointerType | null }) => void;
|
||||
appState: AppState;
|
||||
}) => (
|
||||
<>
|
||||
{SHAPES.map(({ value, icon, key }, index) => {
|
||||
|
@ -217,7 +219,7 @@ export const ShapesSwitcher = ({
|
|||
multiElement: null,
|
||||
selectedElementIds: {},
|
||||
});
|
||||
setCursorForShape(canvas, value);
|
||||
setCursorForShape(canvas, { ...appState, elementType: value });
|
||||
if (value === "image") {
|
||||
onImageAction({ pointerType });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue