mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Deprecate mutateElement, use scene.mutateElement or mutateElementWIth instead
This commit is contained in:
parent
a9c3b2a4d4
commit
94c773a990
45 changed files with 593 additions and 704 deletions
|
@ -45,7 +45,6 @@ import type {
|
|||
|
||||
import { actionSaveToActiveFile } from "../actions";
|
||||
|
||||
import Scene from "../scene/Scene";
|
||||
import { parseClipboard } from "../clipboard";
|
||||
import {
|
||||
actionDecreaseFontSize,
|
||||
|
@ -130,8 +129,7 @@ export const textWysiwyg = ({
|
|||
|
||||
const updateWysiwygStyle = () => {
|
||||
const appState = app.state;
|
||||
const updatedTextElement =
|
||||
Scene.getScene(element)?.getElement<ExcalidrawTextElement>(id);
|
||||
const updatedTextElement = app.scene.getElement<ExcalidrawTextElement>(id);
|
||||
|
||||
if (!updatedTextElement) {
|
||||
return;
|
||||
|
@ -544,7 +542,7 @@ export const textWysiwyg = ({
|
|||
// it'd get stuck in an infinite loop of blur→onSubmit after we re-focus the
|
||||
// wysiwyg on update
|
||||
cleanup();
|
||||
const updateElement = Scene.getScene(element)?.getElement(
|
||||
const updateElement = app.scene.getElement(
|
||||
element.id,
|
||||
) as ExcalidrawTextElement;
|
||||
if (!updateElement) {
|
||||
|
@ -583,6 +581,7 @@ export const textWysiwyg = ({
|
|||
updateElement,
|
||||
container,
|
||||
app.scene.getNonDeletedElementsMap(),
|
||||
(...args) => app.scene.mutate(...args),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue