From 5e6774bd0a1984d73ef31ca5edc387a1354c8693 Mon Sep 17 00:00:00 2001 From: Olli Meier Date: Tue, 22 Oct 2024 08:39:14 +0200 Subject: [PATCH] Bugfix: default value is written to the file instead of the slider value + undo twice before the undo takes place --- .../fontinfo/panel-cross-axis-mapping.js | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/fontra/views/fontinfo/panel-cross-axis-mapping.js b/src/fontra/views/fontinfo/panel-cross-axis-mapping.js index c8462c2a5..c0e93ca5d 100644 --- a/src/fontra/views/fontinfo/panel-cross-axis-mapping.js +++ b/src/fontra/views/fontinfo/panel-cross-axis-mapping.js @@ -314,7 +314,9 @@ class CrossAxisMappingBox extends HTMLElement { this.controllers.inputLocation.addListener((event) => { this.editCrossAxisMapping((mapping) => { mapping.inputLocation[event.key] = event.newValue; - this.controllers.inputLocationCheckboxes.setItem(event.key, true); + document.getElementById( + `${this.mappingIndex}-${event.key}-inputCheckbox` + ).checked = true; }, `edit input location ${event.key}`); }); @@ -336,7 +338,9 @@ class CrossAxisMappingBox extends HTMLElement { this.controllers.outputLocation.addListener((event) => { this.editCrossAxisMapping((mapping) => { mapping.outputLocation[event.key] = event.newValue; - this.controllers.outputLocationCheckboxes.setItem(event.key, true); + document.getElementById( + `${this.mappingIndex}-${event.key}-outputCheckbox` + ).checked = true; }, `edit output location ${event.key}`); }); @@ -449,15 +453,21 @@ class CrossAxisMappingBox extends HTMLElement { const input = buildElementLocations(axis, this.controllers.inputLocation); input.id = `${this.mappingIndex}-${axis.name}-input`; this.append(input); - this.append( - buildElementLocationsCheckboxes(axis, this.controllers.inputLocationCheckboxes) - ); + const inputCheckbox = buildElementLocationsCheckboxes( + axis, + this.controllers.inputLocationCheckboxes + ).firstChild; + inputCheckbox.id = `${this.mappingIndex}-${axis.name}-inputCheckbox`; + this.append(inputCheckbox); const output = buildElementLocations(axis, this.controllers.outputLocation); output.id = `${this.mappingIndex}-${axis.name}-output`; this.append(output); - this.append( - buildElementLocationsCheckboxes(axis, this.controllers.outputLocationCheckboxes) - ); + const outputCheckbox = buildElementLocationsCheckboxes( + axis, + this.controllers.outputLocationCheckboxes + ).firstChild; + outputCheckbox.id = `${this.mappingIndex}-${axis.name}-outputCheckbox`; + this.append(outputCheckbox); this.append( html.div({ class: "fontra-ui-font-info-cross-axis-mapping-panel-column-empty" }) );