Skip to content

Commit

Permalink
Bugfix: default value is written to the file instead of the slider va…
Browse files Browse the repository at this point in the history
…lue + undo twice before the undo takes place
  • Loading branch information
ollimeier committed Oct 22, 2024
1 parent f10ed5e commit 5e6774b
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions src/fontra/views/fontinfo/panel-cross-axis-mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
});

Expand All @@ -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}`);
});

Expand Down Expand Up @@ -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" })
);
Expand Down

0 comments on commit 5e6774b

Please sign in to comment.