mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph] Default window is -10..10 / -10..10
This commit is contained in:
@@ -61,7 +61,8 @@ void GraphController::interestingRanges(float * xm, float * xM, float * ym, floa
|
||||
float xMax = const_cast<GraphController *>(this)->interactiveCurveViewRange()->xMax();
|
||||
assert(functionStore()->numberOfActiveFunctions() > 0);
|
||||
if (displaysNonCartesianFunctions()) {
|
||||
for (int i = 0; i < functionStore()->numberOfActiveFunctions(); i++) {
|
||||
const int functionsCount = functionStore()->numberOfActiveFunctions();
|
||||
for (int i = 0; i < functionsCount; i++) {
|
||||
ExpiringPointer<CartesianFunction> f = functionStore()->modelForRecord(functionStore()->activeRecordAtIndex(i));
|
||||
if (f->plotType() == CartesianFunction::PlotType::Cartesian) {
|
||||
continue;
|
||||
@@ -75,6 +76,10 @@ void GraphController::interestingRanges(float * xm, float * xM, float * ym, floa
|
||||
assert(!std::isnan(f->rangeStep()));
|
||||
interestingFunctionRange(f, tMin, tMax, f->rangeStep(), &resultxMin, &resultxMax, &resultyMin, &resultyMax);
|
||||
}
|
||||
if (resultxMin > resultxMax) {
|
||||
resultxMin = - Range1D::k_default;
|
||||
resultxMax = Range1D::k_default;
|
||||
}
|
||||
} else {
|
||||
resultxMin = xMin;
|
||||
resultxMax = xMax;
|
||||
@@ -96,6 +101,11 @@ void GraphController::interestingRanges(float * xm, float * xM, float * ym, floa
|
||||
double tMax = minFloat(f->tMax(), xMax);
|
||||
interestingFunctionRange(f, tMin, tMax, step, &resultxMin, &resultxMax, &resultyMin, &resultyMax);
|
||||
}
|
||||
if (resultyMin > resultyMax) {
|
||||
resultyMin = - Range1D::k_default;
|
||||
resultyMax = Range1D::k_default;
|
||||
}
|
||||
|
||||
*xm = resultxMin;
|
||||
*xM = resultxMax;
|
||||
*ym = resultyMin;
|
||||
|
||||
@@ -12,7 +12,8 @@ namespace Shared {
|
||||
class __attribute__((packed)) Range1D final {
|
||||
public:
|
||||
constexpr static float k_minFloat = 1E-4f;
|
||||
Range1D(float min = -10.0f, float max = 10.0f) :
|
||||
constexpr static float k_default = 10.0f;
|
||||
Range1D(float min = -k_default, float max = k_default) :
|
||||
m_min(min),
|
||||
m_max(max)
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user