From be51445b7718c256cff80035715326323f2def17 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 8 Nov 2018 22:34:23 +0100 Subject: [PATCH] linepatterns:: width configurable --- config.cpp | 1 + hyper.h | 1 + pattern2.cpp | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/config.cpp b/config.cpp index 8ce1395f..e2626b2d 100644 --- a/config.cpp +++ b/config.cpp @@ -148,6 +148,7 @@ void initConfig() { addsaver(vid.usingGL, "usingGL", true); addsaver(vid.antialias, "antialias", AA_NOGL | AA_FONT | AA_LINES | AA_LINEWIDTH | AA_VERSION); addsaver(vid.linewidth, "linewidth", 1); + addsaver(linepatterns::width, "pattern-linewidth", 1); addsaver(vid.scale, "scale", 1); addsaver(vid.xposition, "xposition", 0); addsaver(vid.yposition, "yposition", 0); diff --git a/hyper.h b/hyper.h index 9fbf0ce6..9273bff6 100644 --- a/hyper.h +++ b/hyper.h @@ -2245,6 +2245,7 @@ namespace linepatterns { }; extern vector patterns; + extern ld width; }; transmatrix ddspin(cell *c, int d, ld bonus = 0); diff --git a/pattern2.cpp b/pattern2.cpp index 06b4bfc9..47b7c4a1 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -2185,7 +2185,11 @@ namespace linepatterns { } } + ld width = 1; + void drawAll() { + + vid.linewidth *= width; if(any()) for(map::iterator it = gmatrix.begin(); it != gmatrix.end(); it++) { cell *c = it->first; @@ -2237,6 +2241,8 @@ namespace linepatterns { } } } + + vid.linewidth /= width; } int numpat = 0; @@ -2260,6 +2266,11 @@ namespace linepatterns { dialog::addBreak(50); dialog::addBack(); + + dialog::addSelItem("line width", fts(width), 'W'); + dialog::add_action([] () { + dialog::editNumber(width, 0, 10, 1, 1, XLAT("line width"), ""); + }); dialog::addBreak(50); dialog::addInfo("change the alpha parameter to show the lines");