From 1938f607838cb051d1365eac704fe12dba9515fd Mon Sep 17 00:00:00 2001 From: verglor Date: Tue, 7 Jul 2026 00:16:46 +0200 Subject: [PATCH] Fix print ignoring user dither/threshold/density settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The print-settings flyout writes density, dither mode, and threshold to the editor store's printSettings, but print() read them from the separate printer store, which those edits never reach. As a result prints always used the defaults (floyd-steinberg, threshold 128, density 2) regardless of what the user selected. Read density/dither/threshold and paperType from the editor store — the same source the flyout writes to — so prints honor the chosen settings. --- packages/web/src/editor/editor.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/web/src/editor/editor.tsx b/packages/web/src/editor/editor.tsx index 01e2bb4..84492c4 100644 --- a/packages/web/src/editor/editor.tsx +++ b/packages/web/src/editor/editor.tsx @@ -10,7 +10,6 @@ import { Palette } from "./palette/palette.tsx"; import { ConnectFlow } from "./connect-flow/connect-flow.tsx"; import { useKeyboardShortcuts, setPrintFn } from "../lib/keyboard.ts"; import { useEditorV2Store } from "../store/editor-store.ts"; -import { usePrinterStore } from "../store/printer-store.ts"; import { getPrinter } from "../hooks/use-web-bluetooth.ts"; import type { RawImageData } from "@thermoprint/core"; @@ -82,8 +81,7 @@ export function Editor() { // Need both a connected printer and a stage to print for real if (!printer || !stage) return false; - const { label } = useEditorV2Store.getState(); - const settings = usePrinterStore.getState().settings; + const { label, printSettings, paperType } = useEditorV2Store.getState(); // Deselect to avoid selection handles in the capture useEditorV2Store.getState().clearSelection(); @@ -112,11 +110,11 @@ export function Editor() { try { // Send to the real printer await printer.print(imageData, { - density: settings.density, - paperType: settings.paperType, + density: printSettings.density, + paperType, copies, - dither: settings.ditherMode as "floyd-steinberg" | "threshold" | "none", - threshold: settings.threshold, + dither: printSettings.ditherMode as "floyd-steinberg" | "threshold" | "none", + threshold: printSettings.threshold, }); } finally { printer.off("progress", offProgress);