From 6f6bcc4584ed40d05b3a97bc228218c92398e5c6 Mon Sep 17 00:00:00 2001 From: "Lu[ke] Wilson" Date: Mon, 20 Nov 2023 15:45:08 +0000 Subject: [PATCH] more tweaks --- src/app/page.tsx | 7 ++++++- src/components/live-image.tsx | 15 ++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 6579aa8..d11cb60 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -28,13 +28,18 @@ export default function Home() { type: "live-image", x: 120, y: 180, + isLocked: true, }); }; return (
- +
); diff --git a/src/components/live-image.tsx b/src/components/live-image.tsx index bd81f45..fd8bc7d 100644 --- a/src/components/live-image.tsx +++ b/src/components/live-image.tsx @@ -51,17 +51,18 @@ export function LiveImage() { const onDrawingChange = useCallback( debounce(async () => { // TODO get actual drawing bounds - const bounds = new Box2d(120, 180, 512, 512); + // const bounds = new Box2d(120, 180, 512, 512); const shapes = editor.getCurrentPageShapes().filter((shape) => { if (shape.type === "live-image") { return false; } - const pageBounds = editor.getShapeMaskedPageBounds(shape); - if (!pageBounds) { - return false; - } - return bounds.includes(pageBounds); + return true; + // const pageBounds = editor.getShapeMaskedPageBounds(shape); + // if (!pageBounds) { + // return false; + // } + // return bounds.includes(pageBounds); }); // Check if should submit request @@ -71,7 +72,7 @@ export function LiveImage() { } imageDigest.current = shapesDigest; - const svg = await editor.getSvg(shapes, { bounds, background: true }); + const svg = await editor.getSvg(shapes, { background: true }); if (!svg) { return; }