linepatterns:: width configurable

This commit is contained in:
Zeno Rogue 2018-11-08 22:34:23 +01:00
parent dbba704d1c
commit be51445b77
3 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -2245,6 +2245,7 @@ namespace linepatterns {
};
extern vector<linepattern> patterns;
extern ld width;
};
transmatrix ddspin(cell *c, int d, ld bonus = 0);

View File

@ -2185,7 +2185,11 @@ namespace linepatterns {
}
}
ld width = 1;
void drawAll() {
vid.linewidth *= width;
if(any()) for(map<cell*, transmatrix>::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");