feat: support setting/resetting cursor from host (#5215)

* Support setting/resetting cursor type from host

* add docs

* minor
This commit is contained in:
Aakansha Doshi 2022-05-20 18:43:38 +05:30 committed by GitHub
parent 92f30f7ed6
commit 07ebd7c68c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 7 deletions

View file

@ -301,7 +301,8 @@ export const setCursorForShape = (
setEraserCursor(canvas, appState.theme);
// do nothing if image tool is selected which suggests there's
// a image-preview set as the cursor
} else if (appState.activeTool.type !== "image") {
// Ignore custom type as well and let host decide
} else if (!["image", "custom"].includes(appState.activeTool.type)) {
canvas.style.cursor = CURSOR_TYPE.CROSSHAIR;
}
};