Cursors: Move common axex.

This commit is contained in:
Kolan Sh 2017-12-03 16:03:51 +03:00
parent dc18d83414
commit 4e89e2682e
1 changed files with 40 additions and 4 deletions

View File

@ -665,6 +665,24 @@ namespace Gtk.CairoChart {
} }
} }
// 4.2. Cursor values for common X axis
if (common_x_axes && si == zoom_first_show && cursors_orientation == CursorOrientation.VERTICAL && cursors_crossings.length != 0) {
switch (s.axis_x.position) {
case Axis.Position.LOW: plot_area_y_max -= max_rec_height + s.axis_x.font_indent; break;
case Axis.Position.HIGH: plot_area_y_min += max_rec_height + s.axis_x.font_indent; break;
case Axis.Position.BOTH: break;
}
}
// 4.2. Cursor values for common Y axis
if (common_y_axes && si == zoom_first_show && cursors_orientation == CursorOrientation.HORIZONTAL && cursors_crossings.length != 0) {
switch (s.axis_y.position) {
case Axis.Position.LOW: plot_area_x_min += max_rec_width + s.axis_y.font_indent; break;
case Axis.Position.HIGH: plot_area_x_max -= max_rec_width + s.axis_y.font_indent; break;
case Axis.Position.BOTH: break;
}
}
if (!common_y_axes || si == zoom_first_show) if (!common_y_axes || si == zoom_first_show)
switch (s.axis_y.position) { switch (s.axis_y.position) {
case Axis.Position.LOW: plot_area_x_min += max_rec_width + max_font_indent + max_axis_font_width; break; case Axis.Position.LOW: plot_area_x_min += max_rec_width + max_font_indent + max_axis_font_width; break;
@ -710,6 +728,15 @@ namespace Gtk.CairoChart {
} }
if (x_min < s.axis_x.zoom_min) x_min += step; if (x_min < s.axis_x.zoom_min) x_min += step;
// 4.2. Cursor values for common X axis
if (common_x_axes && cursors_orientation == CursorOrientation.VERTICAL && cursors_crossings.length != 0) {
switch (s.axis_x.position) {
case Axis.Position.LOW: cur_y_max -= max_rec_height + s.axis_x.font_indent; break;
case Axis.Position.HIGH: cur_y_min += max_rec_height + s.axis_x.font_indent; break;
case Axis.Position.BOTH: break;
}
}
// 4.5. Draw Axis title // 4.5. Draw Axis title
if (s.axis_x.title.text != "") if (s.axis_x.title.text != "")
switch (s.axis_x.position) { switch (s.axis_x.position) {
@ -901,6 +928,15 @@ namespace Gtk.CairoChart {
} }
if (y_min < s.axis_y.zoom_min) y_min += step; if (y_min < s.axis_y.zoom_min) y_min += step;
// 4.2. Cursor values for common Y axis
if (common_y_axes && cursors_orientation == CursorOrientation.HORIZONTAL && cursors_crossings.length != 0) {
switch (s.axis_y.position) {
case Axis.Position.LOW: cur_x_min += max_rec_width + s.axis_y.font_indent; break;
case Axis.Position.HIGH: cur_x_max -= max_rec_width + s.axis_y.font_indent; break;
case Axis.Position.BOTH: break;
}
}
// 4.5. Draw Axis title // 4.5. Draw Axis title
if (s.axis_y.title.text != "") if (s.axis_y.title.text != "")
switch (s.axis_y.position) { switch (s.axis_y.position) {