Commit f2b82484 authored by Mathieu Faverge's avatar Mathieu Faverge
Browse files

Correct text position and negative height

parent d1eaf35a
...@@ -55,9 +55,9 @@ void Render_stats_svg::fill_file(){ ...@@ -55,9 +55,9 @@ void Render_stats_svg::fill_file(){
Element_pos b = *it_rect; Element_pos b = *it_rect;
_svg_file << "<rect width=\"" << w _svg_file << "<rect width=\"" << w
<< "\" height=\"" << -h << "\" height=\"" << h
<< "\" x=\"" << x << "\" x=\"" << x
<< "\" y=\"" << height-(y-_y_min) << "\" y=\"" << height-(y-_y_min)-h
<< "\" fill=\"rgb(" << (int)(r*255)<<","<<(int)(g*255)<<","<<(int)(b*255) << "\" fill=\"rgb(" << (int)(r*255)<<","<<(int)(g*255)<<","<<(int)(b*255)
<< ")\"/>\n"; << ")\"/>\n";
...@@ -88,7 +88,7 @@ void Render_stats_svg::fill_file(){ ...@@ -88,7 +88,7 @@ void Render_stats_svg::fill_file(){
buf_txt = *it_txt; buf_txt = *it_txt;
_svg_file << "<text x=\"" << buf_x _svg_file << "<text x=\"" << buf_x
<<"\" y=\"" << height-(buf_y+10-_y_min) <<"\" y=\"" << height-(buf_y-_y_min)
<< "\">" << buf_txt << "\">" << buf_txt
<< "</text>\n"; << "</text>\n";
}/* end for(...) */ }/* end for(...) */
......
...@@ -149,8 +149,8 @@ inline void Render_stats_svg::start_draw(){ ...@@ -149,8 +149,8 @@ inline void Render_stats_svg::start_draw(){
} }
inline void Render_stats_svg::draw_text(const Element_pos x, const Element_pos y, const std::string value) { inline void Render_stats_svg::draw_text(const Element_pos x, const Element_pos y, const std::string value) {
_y_min = fmin(y, _y_min); _y_min = fmin(y-5, _y_min);
_y_max = fmax(y+10, _y_max); _y_max = fmax(y+5, _y_max);
_text_pos.push_back(x); _text_pos.push_back(x);
_text_pos.push_back(y); _text_pos.push_back(y);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment