diff --git a/config.cpp b/config.cpp index 3127cb35..c76f4298 100644 --- a/config.cpp +++ b/config.cpp @@ -306,6 +306,7 @@ EX void initConfig() { addsaver(vid.antialias, "antialias", AA_NOGL | AA_FONT | (ISWEB ? AA_MULTI : AA_LINES) | AA_LINEWIDTH | AA_VERSION); addsaver(vid.linewidth, "linewidth", 1); addsaver(precise_width, "precisewidth", .5); + addsaver(perfect_linewidth, "perfect_linewidth", 1); addsaver(linepatterns::width, "pattern-linewidth", 1); addsaver(fat_edges, "fat-edges"); addsaver(pconf.scale, "scale", 1); @@ -1156,6 +1157,11 @@ EX void showGraphConfig() { vid.antialias ^= AA_LINEWIDTH; }); + dialog::addBoolItem("perfect width", perfect_linewidth == 2, 'P'); + if(perfect_linewidth == 1) + dialog::lastItem().value = XLAT("shots only"); + dialog::add_action([] { perfect_linewidth = (1 + perfect_linewidth) % 3; }); + if(vid.antialias & AA_LINEWIDTH) { dialog::addSelItem("variable width", fts(precise_width), 'M'); dialog::add_action([] () { diff --git a/drawing.cpp b/drawing.cpp index 77158012..4a7b4efa 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -719,6 +719,8 @@ EX ld scale_at(const transmatrix& T) { return sqrt(hypot_d(2, h2-h1) * hypot_d(2, h3-h1) / .0001); } +EX int perfect_linewidth = 1; + EX ld linewidthat(const hyperpoint& h) { if(!(vid.antialias & AA_LINEWIDTH)) return 1; else if(hyperbolic && pmodel == mdDisk && pconf.alpha == 1 && !ISWEB) { @@ -731,7 +733,7 @@ EX ld linewidthat(const hyperpoint& h) { return dfc; } } - else if(svg::in || inHighQual) { + else if(perfect_linewidth >= (inHighQual ? 1 : 2)) { hyperpoint h0 = h / zlevel(h); transmatrix T = rgpushxto0(h0); return scale_at(T);