T GUI: add a get_range() API function for xy_plot

This commit is contained in:
Cedric Roux
2025-08-18 11:53:54 +02:00
parent c8d64f0dd1
commit ee2668b7c3
2 changed files with 18 additions and 0 deletions
+2
View File
@@ -54,6 +54,8 @@ void container_set_child_growable(gui *_gui, widget *_this,
int xy_plot_new_plot(gui *gui, widget *this, int color);
void xy_plot_set_range(gui *gui, widget *this,
float xmin, float xmax, float ymin, float ymax);
void xy_plot_get_range(gui *gui, widget *this,
float *xmin, float *xmax, float *ymin, float *ymax);
void xy_plot_set_points(gui *gui, widget *this,
int plot, int npoints, float *x, float *y);
void xy_plot_get_dimensions(gui *gui, widget *this, int *width, int *height);
+16
View File
@@ -280,6 +280,22 @@ void xy_plot_set_range(gui *_gui, widget *_this,
gunlock(g);
}
void xy_plot_get_range(gui *_gui, widget *_this,
float *xmin, float *xmax, float *ymin, float *ymax)
{
struct gui *g = _gui;
struct xy_plot_widget *this = _this;
glock(g);
*xmin = this->xmin;
*xmax = this->xmax;
*ymin = this->ymin;
*ymax = this->ymax;
gunlock(g);
}
void xy_plot_set_points(gui *_gui, widget *_this, int plot,
int npoints, float *x, float *y)
{