Cairo-Chart/src/Place.vala

60 lines
1.3 KiB
Vala
Raw Normal View History

2018-01-08 23:33:13 +03:00
namespace CairoChart {
2017-08-22 11:54:18 +03:00
public class Place {
2018-01-08 23:33:13 +03:00
double _x_min = 0;
double _x_max = 0;
double _y_min = 0;
double _y_max = 0;
public double x_min {
get { return _x_min; }
set { _x_min = zoom_x_min = value; }
2017-08-22 11:54:18 +03:00
default = 0;
}
2018-01-08 23:33:13 +03:00
public double x_max {
get { return _x_max; }
set { _x_max = zoom_x_max = value; }
2017-08-22 11:54:18 +03:00
default = 0;
}
2018-01-08 23:33:13 +03:00
public double y_min {
get { return _y_min; }
set { _y_min = zoom_y_min = value; }
2017-08-22 11:54:18 +03:00
default = 0;
}
2018-01-08 23:33:13 +03:00
public double y_max {
get { return _y_max; }
set { _y_max = zoom_y_max = value; }
2017-08-22 11:54:18 +03:00
default = 0;
}
2018-01-08 23:33:13 +03:00
public double zoom_x_min = 0;
public double zoom_x_max = 1;
public double zoom_y_min = 0;
public double zoom_y_max = 1;
2017-08-22 11:54:18 +03:00
2018-01-15 12:05:21 +03:00
public virtual Place copy () {
2017-08-22 11:54:18 +03:00
var place = new Place ();
2018-01-08 23:33:13 +03:00
place.x_min = this.x_min;
place.x_max = this.x_max;
place.y_min = this.y_min;
place.y_max = this.y_max;
2017-08-22 11:54:18 +03:00
return place;
}
2017-08-28 14:47:31 +03:00
2018-01-08 23:33:13 +03:00
public Place (double x_min = 0, double x_max = 1, double y_min = 0, double y_max = 1) {
this.x_min = x_min;
this.x_max = x_max;
this.y_min = y_min;
this.y_max = y_max;
zoom_x_min = x_min;
zoom_x_max = x_max;
zoom_y_min = y_min;
zoom_y_max = y_max;
2017-08-28 14:47:31 +03:00
}
2018-01-19 14:09:50 +03:00
public virtual void unzoom () {
zoom_x_min = x_min;
zoom_x_max = x_max;
zoom_y_min = y_min;
zoom_y_max = y_max;
}
2017-08-28 14:47:31 +03:00
}
}