mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-04 14:30:35 +00:00
svg:: circles now have better linewidth
This commit is contained in:
parent
4d3f33deec
commit
8ba603fba3
3
hyper.h
3
hyper.h
@ -1872,7 +1872,7 @@ namespace shot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace svg {
|
namespace svg {
|
||||||
void circle(int x, int y, int size, color_t col, color_t fillcolor);
|
void circle(int x, int y, int size, color_t col, color_t fillcolor, double linewidth);
|
||||||
void polygon(int *polyx, int *polyy, int polyi, color_t col, color_t outline, double linewidth);
|
void polygon(int *polyx, int *polyy, int polyi, color_t col, color_t outline, double linewidth);
|
||||||
void text(int x, int y, int size, const string& str, bool frame, color_t col, int align);
|
void text(int x, int y, int size, const string& str, bool frame, color_t col, int align);
|
||||||
extern bool in;
|
extern bool in;
|
||||||
@ -2737,6 +2737,7 @@ struct dqi_string : drawqueueitem {
|
|||||||
|
|
||||||
struct dqi_circle : drawqueueitem {
|
struct dqi_circle : drawqueueitem {
|
||||||
int x, y, size, fillcolor;
|
int x, y, size, fillcolor;
|
||||||
|
double linewidth;
|
||||||
void draw();
|
void draw();
|
||||||
virtual color_t outline_group() { return 2; }
|
virtual color_t outline_group() { return 2; }
|
||||||
};
|
};
|
||||||
|
@ -1270,6 +1270,8 @@ void draw_boundary(int w) {
|
|||||||
|
|
||||||
ld fakeinf = sphere ? M_PI-1e-5 : hyperbolic ? 10 : exp(10);
|
ld fakeinf = sphere ? M_PI-1e-5 : hyperbolic ? 10 : exp(10);
|
||||||
|
|
||||||
|
dynamicval<ld> dw(vid.linewidth, vid.linewidth * (svg::in ? svg::divby : 1));
|
||||||
|
|
||||||
if(elliptic && !among(pmodel, mdBand, mdBandEquidistant, mdBandEquiarea, mdSinusoidal))
|
if(elliptic && !among(pmodel, mdBand, mdBandEquidistant, mdBandEquiarea, mdSinusoidal))
|
||||||
circle_around_center(M_PI/2, periodcolor, 0, PPR::CIRCLE);
|
circle_around_center(M_PI/2, periodcolor, 0, PPR::CIRCLE);
|
||||||
|
|
||||||
|
@ -1252,7 +1252,7 @@ void dqi_string::draw() {
|
|||||||
void dqi_circle::draw() {
|
void dqi_circle::draw() {
|
||||||
#if ISMOBILE==0
|
#if ISMOBILE==0
|
||||||
if(svg::in) {
|
if(svg::in) {
|
||||||
svg::circle(x, y, size, color, fillcolor);
|
svg::circle(x, y, size, color, fillcolor, linewidth);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@ -2777,6 +2777,7 @@ void queuecircle(int x, int y, int size, color_t color, PPR prio = PPR::CIRCLE,
|
|||||||
ptd.size = size;
|
ptd.size = size;
|
||||||
ptd.color = color;
|
ptd.color = color;
|
||||||
ptd.fillcolor = fillcolor;
|
ptd.fillcolor = fillcolor;
|
||||||
|
ptd.linewidth = vid.linewidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getcoord0(const hyperpoint& h, int& xc, int &yc, int &sc) {
|
void getcoord0(const hyperpoint& h, int& xc, int &yc, int &sc) {
|
||||||
|
@ -74,10 +74,10 @@ namespace svg {
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void circle(int x, int y, int size, color_t col, color_t fillcol) {
|
void circle(int x, int y, int size, color_t col, color_t fillcol, double linewidth) {
|
||||||
if(!invisible(col) || !invisible(fillcol)) {
|
if(!invisible(col) || !invisible(fillcol)) {
|
||||||
if(vid.stretch == 1)
|
if(vid.stretch == 1)
|
||||||
println(f, "<circle cx='", coord(x), "' cy='", coord(y), "' r='", coord(size), "' ", stylestr(fillcol, col), "/>");
|
println(f, "<circle cx='", coord(x), "' cy='", coord(y), "' r='", coord(size), "' ", stylestr(fillcol, col, linewidth), "/>");
|
||||||
else
|
else
|
||||||
println(f, "<ellipse cx='", coord(x), "' cy='", coord(y), "' rx='", coord(size), "' ry='", coord(size*vid.stretch), "' ", stylestr(fillcol, col), "/>");
|
println(f, "<ellipse cx='", coord(x), "' cy='", coord(y), "' rx='", coord(size), "' ry='", coord(size*vid.stretch), "' ", stylestr(fillcol, col), "/>");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user