From 3390def67c619078fc19836de574624c95ecc02a Mon Sep 17 00:00:00 2001 From: Benjamin Fan Date: Sun, 18 May 2025 09:40:11 +0000 Subject: [PATCH] fix(react): Pattern Layout print settings UI fixes (#351) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #341 Fixes #342 ![Screenshot 2025-05-13 at 4.19.07 PM.png](/attachments/495b1a64-b7e6-40ca-b531-287cea0d29a1) ![Screenshot 2025-05-13 at 4.18.47 PM.png](/attachments/ce8f568e-537e-4f19-b0c1-893253966914) Co-authored-by: Benjamin Fan Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/351 Reviewed-by: Joost De Cock Co-authored-by: Benjamin Fan Co-committed-by: Benjamin Fan --- .../react/components/Editor/components/menus/Value.mjs | 2 +- packages/react/components/Editor/lib/layout-settings.mjs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/react/components/Editor/components/menus/Value.mjs b/packages/react/components/Editor/components/menus/Value.mjs index 5a6cc2e8415..21c0fcc3509 100644 --- a/packages/react/components/Editor/components/menus/Value.mjs +++ b/packages/react/components/Editor/components/menus/Value.mjs @@ -119,7 +119,7 @@ export const MenuMmValue = ({ current, config, units, changed }) => ( * Displays the current percentage value, and the absolute value if configured */ export const MenuPctOptionValue = ({ config, current, settings, changed, patternConfig }) => { - const val = changed ? current : config.pct / 100 + const val = changed ? current : config.dflt return ( diff --git a/packages/react/components/Editor/lib/layout-settings.mjs b/packages/react/components/Editor/lib/layout-settings.mjs index e46751fa2a5..883282ce487 100644 --- a/packages/react/components/Editor/lib/layout-settings.mjs +++ b/packages/react/components/Editor/lib/layout-settings.mjs @@ -20,7 +20,8 @@ const defaultPrintSettings = (units) => ({ size: units === 'imperial' ? 'letter' : 'a4', orientation: 'portrait', margin: units === 'imperial' ? 12.7 : 10, - coverPage: true, + coverPage: 1, + iconSize: 0.5, }) export function menuLayoutSettingsStructure(units) { @@ -76,6 +77,7 @@ export function menuLayoutSettingsStructure(units) { ), }, icon: PageOrientationIcon, + dflt: defaults.orientation, }, margin: { dense: true, @@ -98,7 +100,7 @@ export function menuLayoutSettingsStructure(units) { 0: 'Do not include a cover page', 1: 'Include a cover page', }, - dflt: 0, + dflt: defaults.coverPage, }, iconSize: { dense: true, @@ -108,7 +110,7 @@ export function menuLayoutSettingsStructure(units) { about: 'Controls the size of the icons that allow you to rotate/flip individual pattern parts', min: 10, - dflt: 0.5, + dflt: defaults.iconSize, step: 1, max: 200, },