From 37f5c048051ef15dcb85c778d2cbd4bbbcc902c4 Mon Sep 17 00:00:00 2001
From: dwelle <5153846+dwelle@users.noreply.github.com>
Date: Mon, 24 Jun 2024 23:43:00 +0200
Subject: [PATCH] debug
---
.../actions/actionRemoveBackground.tsx | 36 +++++++++++++------
1 file changed, 26 insertions(+), 10 deletions(-)
diff --git a/packages/excalidraw/actions/actionRemoveBackground.tsx b/packages/excalidraw/actions/actionRemoveBackground.tsx
index b0099bdfe..23c5fff11 100644
--- a/packages/excalidraw/actions/actionRemoveBackground.tsx
+++ b/packages/excalidraw/actions/actionRemoveBackground.tsx
@@ -10,7 +10,7 @@ export const actionRemoveBackground = register({
label: "stats.fullTitle",
trackEvent: false,
viewMode: false,
- async perform(elements, appState, _, app) {
+ async perform(elements, appState, type, app) {
const selectedElements = app.scene.getSelectedElements(appState);
if (
@@ -63,11 +63,11 @@ export const actionRemoveBackground = register({
for (const [, { file, elements }] of filesToProcess) {
const res = await backgroundRemoval.removeBackground(file.dataURL, {
- // debug: true,
+ debug: true,
progress: (...args) => {
console.log("progress", args);
},
- device: "gpu",
+ device: type === "auto" ? undefined : type,
proxyToWorker: true,
});
@@ -101,13 +101,29 @@ export const actionRemoveBackground = register({
},
PanelComponent: ({ updateData }) => {
return (
-
+ <>
+
+
+
+ >
);
},
});