fix: set cursor to auto when not hovering a point on linear element (#9642)

* fix: set cursor to auto when not hovering a point on linear element #9628

* Simplify hover test for cursor

* Add back comment

* Fix test for hit testing

---------

Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Ashwin Temkar 2025-06-11 20:22:02 +05:30 committed by GitHub
parent a7b64f02b3
commit 18808481fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -28,7 +28,7 @@ describe("check rotated elements can be hit:", () => {
//const p = [120, -211];
//const p = [0, 13];
const hit = hitElementItself({
point: pointFrom<GlobalPoint>(87, -68),
point: pointFrom<GlobalPoint>(88, -68),
element: window.h.elements[0],
threshold: 10,
elementsMap: window.h.scene.getNonDeletedElementsMap(),

View File

@ -6147,7 +6147,10 @@ class App extends React.Component<AppProps, AppState> {
setCursor(this.interactiveCanvas, CURSOR_TYPE.AUTO);
} else if (isOverScrollBar) {
setCursor(this.interactiveCanvas, CURSOR_TYPE.AUTO);
} else if (this.state.selectedLinearElement) {
} else if (
this.state.selectedLinearElement &&
hitElement?.id === this.state.selectedLinearElement.elementId
) {
this.handleHoverSelectedLinearElement(
this.state.selectedLinearElement,
scenePointerX,