| 117 | } |
| 118 | |
| 119 | af_err af_set_axes_limits_2d(const af_window window, const float xmin, |
| 120 | const float xmax, const float ymin, |
| 121 | const float ymax, const bool exact, |
| 122 | const af_cell* const props) { |
| 123 | try { |
| 124 | if (window == 0) { AF_ERROR("Not a valid window", AF_ERR_INTERNAL); } |
| 125 | |
| 126 | ForgeManager& fgMngr = forgeManager(); |
| 127 | |
| 128 | fg_chart chart = nullptr; |
| 129 | // The ctype here below doesn't really matter as it is only fetching |
| 130 | // the chart. It will not set it. |
| 131 | // If this is actually being done, then it is extremely bad. |
| 132 | fg_chart_type ctype = FG_CHART_2D; |
| 133 | |
| 134 | if (props->col > -1 && props->row > -1) { |
| 135 | chart = fgMngr.getChart(window, props->row, props->col, ctype); |
| 136 | } else { |
| 137 | chart = fgMngr.getChart(window, 0, 0, ctype); |
| 138 | } |
| 139 | |
| 140 | double _xmin = xmin; |
| 141 | double _xmax = xmax; |
| 142 | double _ymin = ymin; |
| 143 | double _ymax = ymax; |
| 144 | if (!exact) { |
| 145 | _xmin = step_round(_xmin, false); |
| 146 | _xmax = step_round(_xmax, true); |
| 147 | _ymin = step_round(_ymin, false); |
| 148 | _ymax = step_round(_ymax, true); |
| 149 | } |
| 150 | |
| 151 | fgMngr.setChartAxesOverride(chart); |
| 152 | FG_CHECK(forgePlugin().fg_set_chart_axes_limits( |
| 153 | chart, _xmin, _xmax, _ymin, _ymax, 0.0f, 0.0f)); |
| 154 | } |
| 155 | CATCHALL; |
| 156 | return AF_SUCCESS; |
| 157 | } |
| 158 | |
| 159 | af_err af_set_axes_limits_3d(const af_window window, const float xmin, |
| 160 | const float xmax, const float ymin, |
no test coverage detected