|
@@ -26,12 +26,8 @@ export class HTMLShape extends TLBoxShape<HTMLShapeProps> {
|
|
html: '',
|
|
html: '',
|
|
}
|
|
}
|
|
|
|
|
|
- aspectRatio = 480 / 853
|
|
|
|
-
|
|
|
|
- canChangeAspectRatio = false
|
|
|
|
-
|
|
|
|
|
|
+ canChangeAspectRatio = true
|
|
canFlip = false
|
|
canFlip = false
|
|
-
|
|
|
|
canEdit = true
|
|
canEdit = true
|
|
|
|
|
|
ReactComponent = observer(({ events, isErasing, isEditing }: TLComponentProps) => {
|
|
ReactComponent = observer(({ events, isErasing, isEditing }: TLComponentProps) => {
|
|
@@ -48,6 +44,7 @@ export class HTMLShape extends TLBoxShape<HTMLShapeProps> {
|
|
{...events}
|
|
{...events}
|
|
>
|
|
>
|
|
<div
|
|
<div
|
|
|
|
+ className='html-container'
|
|
style={{
|
|
style={{
|
|
width: '100%',
|
|
width: '100%',
|
|
height: '100%',
|
|
height: '100%',
|
|
@@ -73,8 +70,8 @@ export class HTMLShape extends TLBoxShape<HTMLShapeProps> {
|
|
|
|
|
|
validateProps = (props: Partial<HTMLShapeProps>) => {
|
|
validateProps = (props: Partial<HTMLShapeProps>) => {
|
|
if (props.size !== undefined) {
|
|
if (props.size !== undefined) {
|
|
- props.size[0] = Math.max(props.size[0], 1)
|
|
|
|
- props.size[1] = Math.max(props.size[0] * this.aspectRatio, 1)
|
|
|
|
|
|
+ props.size[0] = Math.max(props.size[0], 120)
|
|
|
|
+ props.size[1] = Math.max(props.size[1], 80)
|
|
}
|
|
}
|
|
return withClampedStyles(props)
|
|
return withClampedStyles(props)
|
|
}
|
|
}
|