diff --git a/graph.cpp b/graph.cpp index 3bb865cf..74cc06d5 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5413,6 +5413,8 @@ int ringcolor = darkena(0xFF, 0, 0xFF); function wrap_drawfullmap = drawfullmap; +bool force_sphere_outline = false; + void drawfullmap() { DEBB(DF_GRAPH, (debugfile,"draw full map\n")); @@ -5421,20 +5423,24 @@ void drawfullmap() { if(!stereo::active() && !euclid && (pmodel == mdDisk || pmodel == mdBall || (sphere && mdEqui()))) { double rad = vid.radius; + bool isbnd = true; if(sphere) { if(mdEqui()) ; - else if(!vid.grid && !elliptic) + else if(!vid.grid && !elliptic && !force_sphere_outline) rad = 0; else if(vid.alpha <= 0) ; else if(vid.alpha <= 1 && (vid.grid || elliptic)) // mark the equator - rad = rad * 1 / vid.alpha; - else if(vid.grid) // mark the edge + rad = rad * 1 / vid.alpha, isbnd = false; + else if(vid.grid || force_sphere_outline) // mark the edge rad /= sqrt(vid.alpha*vid.alpha - 1); } - if(!haveaura()) queuecircle(vid.xcenter, vid.ycenter, rad, ringcolor, - vid.usingGL ? PPR_CIRCLE : PPR_OUTCIRCLE); + if(rad && !haveaura()) { + queuecircle(vid.xcenter, vid.ycenter, rad, ringcolor, + vid.usingGL ? PPR_CIRCLE : PPR_OUTCIRCLE); + if(isbnd) lastptd().u.cir.boundary = true; + } if(pmodel == mdBall) ballgeometry(); } diff --git a/hyper.h b/hyper.h index 88b9d751..67ec4ff9 100644 --- a/hyper.h +++ b/hyper.h @@ -2063,6 +2063,7 @@ struct qchr { struct qcir { int x, y, size; + bool boundary; }; enum eKind { pkPoly, pkLine, pkString, pkCircle, pkShape, pkResetModel, pkSpecial }; diff --git a/polygons.cpp b/polygons.cpp index 4a518670..92c797d6 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -806,10 +806,24 @@ void drawqueue() { } #endif + #ifdef STLSORT + #define GET_PTD(i) polytodraw& ptd (ptds[i]); + #else + #define GET_PTD(i) polytodraw& ptd (*ptds2[i]); + #endif + spherespecial = 0; spherephase = 0; // on the sphere, parts on the back are drawn first if(sphere && pmodel == 0) { + + // in SVG, draw boundary circle first + if(svg::in) for(int i=0; i=0; i--) { - #ifdef STLSORT - polytodraw& ptd (ptds[i]); - #else - polytodraw& ptd (*ptds2[i]); - #endif + GET_PTD(i); if(ptd.kind == pkPoly || ptd.kind == pkLine) { unsigned c = ptd.col; int alpha = ptd.col & 255; @@ -841,11 +851,8 @@ void drawqueue() { spherephase = 1; } for(int i=0; i