mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 18:41:23 +01:00
EDIT style text label stroke color
This commit is contained in:
parent
a2e1004734
commit
7ff5d1053f
3 changed files with 26 additions and 4 deletions
|
|
@ -201,6 +201,8 @@ function selectStyleElement() {
|
|||
|
||||
if (gridCellNumbers) {
|
||||
gridCellNumbers.checked = el.attr("cell-numbers") === "true";
|
||||
styleStroke.style.display = "block";
|
||||
styleStrokeInput.value = styleStrokeOutput.value = gridOverlay.attr("data-label-style")?.match(/stroke: ([^;]+)/)?.[1] || "#000000";
|
||||
gridCellNumbers.addEventListener("change", function() {
|
||||
el.attr("cell-numbers", this.checked);
|
||||
drawGrid();
|
||||
|
|
@ -208,6 +210,7 @@ function selectStyleElement() {
|
|||
} else {
|
||||
console.warn("gridCellNumbers element not found");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (styleElement === "compass") {
|
||||
|
|
@ -542,10 +545,21 @@ styleGridNumbers.on("change", function () {
|
|||
|
||||
byId("gridCellNumbers")?.addEventListener("change", function() {
|
||||
gridOverlay.attr("cell-numbers", this.checked);
|
||||
// drawGrid(); // without condition of if layerIsOn.
|
||||
updateGridCellNumbersStyle();
|
||||
if (layerIsOn("toggleGrid")) drawGrid();
|
||||
});
|
||||
|
||||
document.getElementById("gridCellNumbersColor").addEventListener("input", updateGridCellNumbersStyle);
|
||||
|
||||
function updateGridCellNumbersStyle() {
|
||||
const color = document.getElementById("gridCellNumbersColor").value;
|
||||
|
||||
const style = `stroke: ${color};`;
|
||||
gridOverlay.attr("data-label-style", style);
|
||||
|
||||
if (layerIsOn("toggleGrid")) drawGrid();
|
||||
}
|
||||
|
||||
styleRescaleMarkers.on("change", function () {
|
||||
markers.attr("rescale", +this.checked);
|
||||
invokeActiveZooming();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue