mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-19 10:31:24 +01:00
Ruler polyline width Style interface
for white line and gray line.
This commit is contained in:
parent
f50b077f84
commit
c2c58c2894
4 changed files with 75 additions and 30 deletions
|
|
@ -140,8 +140,11 @@ class Ruler extends Measurer {
|
|||
const points = this.getPointsString();
|
||||
const size = this.getSize();
|
||||
const dash = this.getDash();
|
||||
|
||||
const whiteColor = localStorage.getItem("rulerWhiteLineColor") || "#ffffff";
|
||||
const grayColor = localStorage.getItem("rulerGrayLineColor") || "#808080";
|
||||
const whiteWidth = parseFloat(localStorage.getItem("rulerWhiteLineWidth")) || 1;
|
||||
const grayWidth = parseFloat(localStorage.getItem("rulerGrayLineWidth")) || 1.2;
|
||||
|
||||
const el = (this.el = ruler
|
||||
.append("g")
|
||||
|
|
@ -152,13 +155,13 @@ class Ruler extends Measurer {
|
|||
.attr("points", points)
|
||||
.attr("class", "white")
|
||||
.style("stroke", whiteColor)
|
||||
.attr("stroke-width", size)
|
||||
.style("stroke-width", size * whiteWidth)
|
||||
.call(d3.drag().on("start", () => this.addControl(this)));
|
||||
el.append("polyline")
|
||||
.attr("points", points)
|
||||
.attr("class", "gray")
|
||||
.style("stroke", grayColor)
|
||||
.attr("stroke-width", rn(size * 1.2, 2))
|
||||
.style("stroke-width", size * grayWidth)
|
||||
.attr("stroke-dasharray", dash);
|
||||
el.append("g")
|
||||
.attr("class", "rulerPoints")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue