OK In progress...

This commit is contained in:
Kolan Sh 2018-01-19 14:25:53 +03:00
parent e2c43bad45
commit d77af13521
1 changed files with 4 additions and 2 deletions

View File

@ -278,10 +278,12 @@ namespace CairoChart {
d.x *= x1 - x0; d.y *= y1 - y0;
var px1 = plarea.x + plarea.width;
var py1 = plarea.y + plarea.height;
if (xmin + d.x < plarea.x) d.x = plarea.x - xmin;
if (xmax + d.x > plarea.x + plarea.width) d.x = plarea.x + plarea.width - xmax;
if (xmax + d.x > px1) d.x = px1 - xmax;
if (ymin + d.y < plarea.y) d.y = plarea.y - ymin;
if (ymax + d.y > plarea.y + plarea.height) d.y = plarea.y + plarea.height - ymax;
if (ymax + d.y > py1) d.y = py1 - ymax;
zoom_in (Cairo.Rectangle(){x = xmin + d.x, y = ymin + d.y, width = xmax - xmin, height = ymax - ymin});
}