In progress...
This commit is contained in:
parent
0a1ccba521
commit
a2ed8e2e25
|
@ -21,13 +21,18 @@ namespace CairoChart {
|
||||||
return step;
|
return step;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool are_intersect (double a_min, double a_max, double b_min, double b_max) {
|
internal bool coord_cross (double a_min, double a_max, double b_min, double b_max) {
|
||||||
if ( a_min < a_max <= b_min < b_max
|
if ( a_min < a_max <= b_min < b_max
|
||||||
|| b_min < b_max <= a_min < a_max)
|
|| b_min < b_max <= a_min < a_max)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal bool rect_cross (Cairo.Rectangle r1, Cairo.Rectangle r2) {
|
||||||
|
return coord_cross(r1.x, r1.x + r1.width, r2.x, r2.x + r2.width)
|
||||||
|
&& coord_cross(r1.y, r1.y + r1.height, r2.y, r2.y + r2.height);
|
||||||
|
}
|
||||||
|
|
||||||
internal bool point_belong (Float128 p, Float128 a, Float128 b) {
|
internal bool point_belong (Float128 p, Float128 a, Float128 b) {
|
||||||
if (a > b) { Float128 tmp = a; a = b; b = tmp; }
|
if (a > b) { Float128 tmp = a; a = b; b = tmp; }
|
||||||
if (a <= p <= b) return true;
|
if (a <= p <= b) return true;
|
||||||
|
|
|
@ -188,7 +188,7 @@ namespace CairoChart {
|
||||||
for (int sk = si; sk > sj; --sk) {
|
for (int sk = si; sk > sj; --sk) {
|
||||||
var s3 = chart.series[sk];
|
var s3 = chart.series[sk];
|
||||||
if (!s3.zoom_show) continue;
|
if (!s3.zoom_show) continue;
|
||||||
if (Math.are_intersect(s2.place.zoom_x_min, s2.place.zoom_x_max, s3.place.zoom_x_min, s3.place.zoom_x_max)
|
if (Math.coord_cross(s2.place.zoom_x_min, s2.place.zoom_x_max, s3.place.zoom_x_min, s3.place.zoom_x_max)
|
||||||
|| s2.axis_x.position != s3.axis_x.position
|
|| s2.axis_x.position != s3.axis_x.position
|
||||||
|| s2.axis_x.type != s3.axis_x.type) {
|
|| s2.axis_x.type != s3.axis_x.type) {
|
||||||
has_intersection = true;
|
has_intersection = true;
|
||||||
|
@ -226,7 +226,7 @@ namespace CairoChart {
|
||||||
for (int sk = si; sk > sj; --sk) {
|
for (int sk = si; sk > sj; --sk) {
|
||||||
var s3 = chart.series[sk];
|
var s3 = chart.series[sk];
|
||||||
if (!s3.zoom_show) continue;
|
if (!s3.zoom_show) continue;
|
||||||
if (Math.are_intersect(s2.place.zoom_y_min, s2.place.zoom_y_max, s3.place.zoom_y_min, s3.place.zoom_y_max)
|
if (Math.coord_cross(s2.place.zoom_y_min, s2.place.zoom_y_max, s3.place.zoom_y_min, s3.place.zoom_y_max)
|
||||||
|| s2.axis_y.position != s3.axis_y.position
|
|| s2.axis_y.position != s3.axis_y.position
|
||||||
|| s2.axis_y.type != s3.axis_y.type) {
|
|| s2.axis_y.type != s3.axis_y.type) {
|
||||||
has_intersection = true;
|
has_intersection = true;
|
||||||
|
|
Loading…
Reference in New Issue