In progress...

This commit is contained in:
Kolan Sh 2018-01-18 17:53:12 +03:00
parent 87e05a20b2
commit 29b4cac4f9
2 changed files with 3 additions and 10 deletions

View File

@ -104,6 +104,7 @@ namespace CairoChart {
/** /**
* TODO: remove all indent fields / evaluate automatically. * TODO: remove all indent fields / evaluate automatically.
* @deprecated 0.1.1
*/ */
public double title_indent = 4; public double title_indent = 4;
@ -350,15 +351,6 @@ namespace CairoChart {
} }
} }
public virtual Float128 scr2rel_x (Float128 x) {
return zoom.x + (x - plarea.x) / plarea.width * zoom.width;
}
public virtual Float128 scr2rel_y (Float128 y) {
return zoom.y + zoom.height - (plarea.y + plarea.height - y) / plarea.height * zoom.height;
}
public virtual Point scr2rel_point (Point p) {
return Point (scr2rel_x(p.x), scr2rel_y(p.y));
}
public virtual Float128 rel2scr_x(Float128 x) { public virtual Float128 rel2scr_x(Float128 x) {
return plarea.x + plarea.width * (x - zoom.x) / zoom.width; return plarea.x + plarea.width * (x - zoom.x) / zoom.width;
} }

View File

@ -56,7 +56,8 @@ namespace CairoChart {
} }
public virtual void set_active_cursor (Chart chart, Point p, bool remove = false) { public virtual void set_active_cursor (Chart chart, Point p, bool remove = false) {
active_cursor = chart.scr2rel_point(p); active_cursor.x = chart.zoom.x + (p.x - chart.plarea.x) / chart.plarea.width * chart.zoom.width;
active_cursor.y = chart.zoom.y + chart.zoom.height - (chart.plarea.y + chart.plarea.height - p.y) / chart.plarea.height * chart.zoom.height;
is_cursor_active = ! remove; is_cursor_active = ! remove;
} }