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:
@ -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 });
|
||||
}
|
||||
|
Reference in New Issue
Block a user