From b8b1df01e7e6cc9053eb53417da4caa6bda18552 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 23 Oct 2022 15:40:37 +0200 Subject: [PATCH] fixed some linewidth issues --- drawing.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drawing.cpp b/drawing.cpp index adc55230..fbc58626 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -809,7 +809,13 @@ void dqi_poly::gldraw() { #endif EX ld scale_at(const shiftmatrix& T) { - if(GDIM == 3 && pmodel == mdPerspective) return 1 / abs((tC0(unshift(T)))[2]); + if(GDIM == 3 && pmodel == mdPerspective) { + ld z = (tC0(unshift(T)))[2]; + if(z == 0) return 1; + z = 1 / abs(z); + if(z > 10) return 10; + return z; + } if(sol) return 1; hyperpoint h1, h2, h3; applymodel(tC0(T), h1); @@ -841,6 +847,17 @@ EX ld linewidthat(const shiftpoint& h) { return dfc; } } + else if(hyperbolic && pmodel == mdRelPerspective) { + if(abs(h[3]) < 1e-6) return 1; + return 1 / (1 + abs(h[3])); + } + else if(sl2 && pmodel == mdRelPerspective) { + if(abs(h[2]) < 1e-6) return 1; + return 1 / (1 + abs(h[2])); + } + else if(hyperbolic && GDIM == 3 && pmodel == mdPerspective && pconf.alpha == 0 && h[3] < 0.99) { + return 1; + } else if(perfect_linewidth >= (inHighQual ? 1 : 2)) { hyperpoint h0 = h.h / zlevel(h.h); shiftmatrix T = shiftless(rgpushxto0(h0), h.shift);