mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph/graph] When redrawing the curve, slightly exceed the rect to
ensure the continuity of the curve Change-Id: I7dcdc53dc14819b7bf1327a7ba98d459b3bc9c63
This commit is contained in:
@@ -131,13 +131,14 @@ const uint8_t stampMask[stampSize+1][stampSize+1] = {
|
||||
|
||||
constexpr static int k_maxNumberOfIterations = 10;
|
||||
constexpr static int k_resolution = 320.0f;
|
||||
constexpr static int k_externRectMargin = 1;
|
||||
|
||||
void CurveView::drawCurve(void * curve, KDColor color, KDContext * ctx, KDRect rect, bool colorUnderCurve, float colorLowerBound, float colorUpperBound, bool continuously) const {
|
||||
float xMin = min(Axis::Horizontal);
|
||||
float xMax = max(Axis::Horizontal);
|
||||
float xStep = (xMax-xMin)/k_resolution;
|
||||
float rectMin = pixelToFloat(Axis::Horizontal, rect.left());
|
||||
float rectMax = pixelToFloat(Axis::Horizontal, rect.right());
|
||||
float rectMin = pixelToFloat(Axis::Horizontal, rect.left() - k_externRectMargin);
|
||||
float rectMax = pixelToFloat(Axis::Horizontal, rect.right() + k_externRectMargin);
|
||||
for (float x = rectMin; x < rectMax; x += xStep) {
|
||||
float y = evaluateCurveAtAbscissa(curve, x);
|
||||
float pxf = floatToPixel(Axis::Horizontal, x);
|
||||
|
||||
Reference in New Issue
Block a user