setParent(el?.parentElement ?? null)} style={{ display: 'none' }} />
+ {target && createPortal(children, target)}
+ >
+ )
+}
diff --git a/src/components/LiveImageShapeUtil.tsx b/src/components/LiveImageShapeUtil.tsx
index 0d7e220..b58eee5 100644
--- a/src/components/LiveImageShapeUtil.tsx
+++ b/src/components/LiveImageShapeUtil.tsx
@@ -2,6 +2,7 @@
/* eslint-disable react-hooks/rules-of-hooks */
import {
AssetRecordType,
+ Button,
Geometry2d,
getDefaultColorTheme,
Rectangle2d,
@@ -51,13 +52,14 @@ export type LiveImageShape = TLBaseShape<
w: number
h: number
name: string
+ overlayResult?: boolean
}
>
export class LiveImageShapeUtil extends ShapeUtil
{
static type = 'live-image' as any
- override canBind = () => true
+ override canBind = () => false
override canUnmount = () => false
override canEdit = () => true
override isAspectRatioLocked = () => true
@@ -107,7 +109,6 @@ export class LiveImageShapeUtil extends ShapeUtil {
override onDragShapesOut = (_shape: LiveImageShape, shapes: TLShape[]): void => {
const parent = this.editor.getShape(_shape.parentId)
const isInGroup = parent && this.editor.isShapeOfType(parent, 'group')
-
if (isInGroup) {
this.editor.reparentShapes(shapes, parent.id)
} else {
@@ -161,7 +162,6 @@ export class LiveImageShapeUtil extends ShapeUtil {
const assetId = AssetRecordType.createId(shape.id.split(':')[1])
const asset = editor.getAsset(assetId)
- // eslint-disable-next-line react-hooks/rules-of-hooks
const theme = getDefaultColorTheme({ isDarkMode: useIsDarkMode() })
return (
@@ -181,7 +181,7 @@ export class LiveImageShapeUtil extends ShapeUtil {
width={bounds.width}
height={bounds.height}
/>
- {asset && (
+ {!shape.props.overlayResult && asset && (
{
}}
/>
)}
+