Skip to content

Commit

Permalink
Removed x-axis-select, y-axis-select, and minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorp committed Feb 6, 2024
1 parent 5ab1578 commit 842a81d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/fencer.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ <h3>Mappings visual
<!-- <div id="mappings-visual">
</div> -->
<div id="mappings-ui-info">


<!-- <div id="mappings-ui-info">
<label for="#x-axis-select">x-axis</label><select id="x-axis-select"></select>
<label for="#y-axis-select">y-axis</label><select id="y-axis-select"></select>
</div>
</div> -->
</div>

<div class="mappings-xml">
Expand Down
13 changes: 4 additions & 9 deletions src/fencer.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ function onDropFont (e) {
}
}

/*
// init x-axis-select and y-axis-select select elements
const xAxisSelectEl = document.querySelector("#x-axis-select");
const yAxisSelectEl = document.querySelector("#y-axis-select");
Expand All @@ -237,6 +238,7 @@ function onDropFont (e) {
xAxisSelectEl.append(xOption);
yAxisSelectEl.append(yOption);
});
*/

// // init global axis values
// GLOBAL.axisValues = [];
Expand All @@ -247,6 +249,7 @@ function onDropFont (e) {
// draw mappings SVG
updateMappingsSVG();


refreshResults();
});
}
Expand Down Expand Up @@ -500,25 +503,17 @@ function refreshResults() {
});
}
else {
//const thisRenderVariationSettings = [];
const axisValues = getCurrentAxisValues();
const axisEls = renderItemEl.querySelectorAll(".axis");

// get the locked/unlocked status of each axis
axisEls.forEach((axisEl, a) => {
const axis = GLOBAL.font.fvar.axes[a];
const valueEl = axisEl.querySelector(".value");
if (!axisEl.querySelector(".lock").classList.contains("locked")) {
valueEl.value = axisValues[a];
valueEl.value = axisValues[a]; // if unlocked, update it to the current axis value
}
//thisRenderVariationSettings.push(`"${axis.axisTag}" ${valueEl.value}`);
fvsEntries.push(`"${axis.axisTag}" ${valueEl.value}`);
//});
});

//renderEl.style.fontVariationSettings = thisRenderVariationSettings.join();
}

renderEl.style.fontVariationSettings = fvsEntries.join();
});
}
Expand Down

0 comments on commit 842a81d

Please sign in to comment.