mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] Change Zoom API
Moved some code around to decrease redundancy and put more of the logic into Poincare::Zoom Change-Id: I4804cf39493ac7f2f0b3c4eb554e5c15c3cef1c9
This commit is contained in:
committed by
Émilie Feral
parent
8572f4953c
commit
6be5e7d62c
@@ -9,6 +9,7 @@
|
||||
#include <poincare/integer.h>
|
||||
#include <poincare/rational.h>
|
||||
#include <poincare/addition.h>
|
||||
#include <poincare/zoom.h>
|
||||
#include "../shared/poincare_helpers.h"
|
||||
#include <string.h>
|
||||
#include <apps/i18n.h>
|
||||
@@ -310,6 +311,15 @@ Expression Sequence::sumBetweenBounds(double start, double end, Poincare::Contex
|
||||
return Float<double>::Builder(result);
|
||||
}
|
||||
|
||||
void Sequence::rangeForDisplay(float * xMin, float * xMax, float * yMin, float * yMax, Poincare::Context * context) const {
|
||||
Poincare::Zoom::ValueAtAbscissa evaluation = [](float x, Poincare::Context * context, const void * auxiliary) {
|
||||
return static_cast<float>(static_cast<const Shared::Sequence *>(auxiliary)->initialRank());
|
||||
};
|
||||
Poincare::Zoom::FullRange(evaluation, 0, 1, 1, xMin, xMax, context, this);
|
||||
*xMax += Poincare::Zoom::k_defaultHalfRange;
|
||||
protectedFullRangeForDisplay(*xMin, *xMax, 1.f, yMin, yMax, context, false);
|
||||
}
|
||||
|
||||
Sequence::RecordDataBuffer * Sequence::recordData() const {
|
||||
assert(!isNull());
|
||||
Ion::Storage::Record::Data d = value();
|
||||
|
||||
Reference in New Issue
Block a user