PoC: Expose wysiwyg element to manipulate from outside (#1356)
* expose wysiwyg element to manipulate from outside * keep focus after changing style * update editingElement correctly * remove mistake * update text only * proper check for element * udpate snapshots * add error log * remove try catch handler * remove blur event * add proper types * merge if condition * simplify if condition Co-Authored-By: Lipis <lipiridis@gmail.com> Co-authored-by: dwelle <luzar.david@gmail.com> Co-authored-by: Lipis <lipiridis@gmail.com> Co-authored-by: Fausto95 <faustino.kialungila@gmail.com>
This commit is contained in:
src
@ -14,6 +14,7 @@ import {
|
||||
handlerRectangles,
|
||||
getCommonBounds,
|
||||
canResizeMutlipleElements,
|
||||
isTextElement,
|
||||
} from "../element";
|
||||
|
||||
import { roundRect } from "./roundRect";
|
||||
@ -103,6 +104,18 @@ export function renderScene(
|
||||
return { atLeastOneVisibleElement: false };
|
||||
}
|
||||
|
||||
if (
|
||||
appState.wysiwygElement?.changeStyle &&
|
||||
isTextElement(appState.editingElement)
|
||||
) {
|
||||
appState.wysiwygElement.changeStyle({
|
||||
font: appState.editingElement.font,
|
||||
textAlign: appState.editingElement.textAlign,
|
||||
color: appState.editingElement.strokeColor,
|
||||
opacity: appState.editingElement.opacity,
|
||||
});
|
||||
}
|
||||
|
||||
const context = canvas.getContext("2d")!;
|
||||
context.scale(scale, scale);
|
||||
|
||||
|
Reference in New Issue
Block a user