suport iFrame

This commit is contained in:
zsviczian 2023-11-25 05:43:25 +00:00
parent 9da3e47877
commit 44390cb146
6 changed files with 14 additions and 9 deletions

View file

@ -153,6 +153,7 @@ export const newIframeElement = (
): NonDeleted<ExcalidrawIframeElement> => {
return {
..._newElementBase<ExcalidrawIframeElement>("iframe", opts),
scale: [1, 1],
};
};

View file

@ -27,6 +27,7 @@ import {
import {
isArrowElement,
isBoundToContainer,
isIframeLikeElement,
isFrameLikeElement,
isFreeDrawElement,
isImageElement,
@ -586,7 +587,7 @@ export const resizeSingleElement = (
};
if ("scale" in element && "scale" in stateAtResizeStart) {
if (isFrameLikeElement(element)) {
if (isIframeLikeElement(element)) {
if (shouldMaintainAspectRatio) {
const scale: [number, number] = [
Math.abs(

View file

@ -104,6 +104,7 @@ export type ExcalidrawIframeElement = _ExcalidrawElementBase &
type: "iframe";
// TODO move later to AI-specific frame
customData?: { generationData?: MagicCacheData };
scale: [number, number];
}>;
export type ExcalidrawIframeLikeElement =