[fix] handles updates (#1779)

This PR fixes the signals in the `HandlesWrapper` component.

### Change Type

- [x] `patch` — Bug fix
pull/1781/head
Steve Ruiz 2023-07-29 23:44:57 +01:00 zatwierdzone przez GitHub
rodzic af0f0f8d8b
commit 3a3f5b595e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 11 dodań i 6 usunięć

Wyświetl plik

@ -190,15 +190,20 @@ function HandlesWrapper() {
editor,
])
const isReadonly = useValue('isChangingStyle', () => editor.instanceState.isReadonly, [editor])
const handles = useValue(
'handles',
() => (editor.onlySelectedShape ? editor.getHandles(editor.onlySelectedShape) : undefined),
[editor]
)
const transform = useValue(
'transform',
() =>
editor.onlySelectedShape ? editor.getPageTransform(editor.onlySelectedShape) : undefined,
[editor]
)
if (!Handles || !onlySelectedShape || isChangingStyle || isReadonly) return null
const handles = editor.getHandles(onlySelectedShape)
if (!handles) return null
const transform = editor.getPageTransform(onlySelectedShape)
if (!transform) return null
// Don't display a temporary handle if the distance between it and its neighbors is too small.