gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'agg-plot/text.cpp')
-rw-r--r--agg-plot/text.cpp 7
1 files changed, 5 insertions, 2 deletions
diff --git a/agg-plot/text.cpp b/agg-plot/text.cpp
index 09a1fb0b..df04cd34 100644
--- a/agg-plot/text.cpp
+++ b/agg-plot/text.cpp
@@ -45,7 +45,7 @@ namespace draw {
}
str
- text::write_svg(int id, agg::rgba8 c)
+ text::write_svg(int id, agg::rgba8 c, double h)
{
const agg::trans_affine& m = m_user_matrix;
const double eps = 1.0e-6;
@@ -78,12 +78,15 @@ namespace draw {
y += m.ty;
}
+ double x_svg = x, y_svg = svg_y_coord(y, h);
+
const char* cont = m_text_buf.cstr();
str txt = str::print("<text x=\"%g\" y=\"%g\" id=\"text%i\"" \
" style=\"font-size:%i%s\">" \
" <tspan x=\"%g\" y=\"%g\" id=\"tspan%i\">%s</tspan>" \
"</text>",
- x, y, id, txt_size, style.cstr(), x, y, id, cont);
+ x_svg, y_svg, id, txt_size, style.cstr(),
+ x_svg, y_svg, id, cont);
if (need_rotate) {
s = str::print("<g transform=\"matrix(%g,%g,%g,%g,%g,%g)\">%s</g>",
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月17日 09:39:39 +0000

AltStyle によって変換されたページ (->オリジナル) /