mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 18:41:23 +01:00
Show/hide text of "ruler" class
This commit is contained in:
parent
c2c58c2894
commit
bb35d5149c
7 changed files with 86 additions and 12 deletions
|
|
@ -145,6 +145,8 @@ class Ruler extends Measurer {
|
|||
const grayColor = localStorage.getItem("rulerGrayLineColor") || "#808080";
|
||||
const whiteWidth = parseFloat(localStorage.getItem("rulerWhiteLineWidth")) || 1;
|
||||
const grayWidth = parseFloat(localStorage.getItem("rulerGrayLineWidth")) || 1.2;
|
||||
const showText = localStorage.getItem("rulerShowText") !== "false"; // by default, show the text
|
||||
|
||||
|
||||
const el = (this.el = ruler
|
||||
.append("g")
|
||||
|
|
@ -170,6 +172,7 @@ class Ruler extends Measurer {
|
|||
el.append("text")
|
||||
.attr("dx", ".35em")
|
||||
.attr("dy", "-.45em")
|
||||
.style("display", showText ? "inline" : "none")
|
||||
.on("click", () => rulers.remove(this.id));
|
||||
this.drawPoints(el);
|
||||
this.updateLabel();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue