diff --git a/apps/shared/curve_view.cpp b/apps/shared/curve_view.cpp index 8fc9261a7..4ef575c77 100644 --- a/apps/shared/curve_view.cpp +++ b/apps/shared/curve_view.cpp @@ -523,7 +523,7 @@ void CurveView::drawCurve(KDContext * ctx, KDRect rect, EvaluateModelWithParamet if (colorUnderCurve && colorLowerBound < x && x < colorUpperBound) { drawSegment(ctx, rect, Axis::Vertical, x, minFloat(0.0f, y), maxFloat(0.0f, y), color, 1); } - jointDots(ctx, rect, xEvaluation, yEvaluation, model, context, x - xStep, previousY, x, y, color, k_maxNumberOfIterations); + jointDots(ctx, rect, xEvaluation, yEvaluation, model, context, x - xStep, x - xStep, previousY, x, x, y, color, k_maxNumberOfIterations); } } @@ -571,7 +571,7 @@ void CurveView::drawHistogram(KDContext * ctx, KDRect rect, EvaluateModelWithPar } } -void CurveView::jointDots(KDContext * ctx, KDRect rect, EvaluateModelWithParameter xEvaluation, EvaluateModelWithParameter yEvaluation, void * model, void * context, float x, float y, float u, float v, KDColor color, int maxNumberOfRecursion) const { +void CurveView::jointDots(KDContext * ctx, KDRect rect, EvaluateModelWithParameter xEvaluation, EvaluateModelWithParameter yEvaluation, void * model, void * context, float t, float x, float y, float s, float u, float v, KDColor color, int maxNumberOfRecursion) const { float pxf = floatToPixel(Axis::Horizontal, x); float pyf = floatToPixel(Axis::Vertical, y); float puf = floatToPixel(Axis::Horizontal, u); @@ -584,6 +584,7 @@ void CurveView::jointDots(KDContext * ctx, KDRect rect, EvaluateModelWithParamet return; } // C is the dot whose abscissa is between x and u + float ct = (t + s)/2.0f; float cx = (x + u)/2.0f; float cy = yEvaluation(cx, model, context); if ((y <= cy && cy <= v) || (v <= cy && cy <= y)) { @@ -593,8 +594,8 @@ void CurveView::jointDots(KDContext * ctx, KDRect rect, EvaluateModelWithParamet return; } if (maxNumberOfRecursion > 0) { - jointDots(ctx, rect, xEvaluation, yEvaluation, model, context, x, y, cx, cy, color, maxNumberOfRecursion-1); - jointDots(ctx, rect, xEvaluation, yEvaluation, model, context, cx, cy, u, v, color, maxNumberOfRecursion-1); + jointDots(ctx, rect, xEvaluation, yEvaluation, model, context, t, x, y, ct, cx, cy, color, maxNumberOfRecursion-1); + jointDots(ctx, rect, xEvaluation, yEvaluation, model, context, ct, cx, cy, s, u, v, color, maxNumberOfRecursion-1); } } diff --git a/apps/shared/curve_view.h b/apps/shared/curve_view.h index 360020417..3dea6c1c8 100644 --- a/apps/shared/curve_view.h +++ b/apps/shared/curve_view.h @@ -83,7 +83,7 @@ private: int numberOfLabels(Axis axis) const; /* Recursively join two dots (dichotomy). The method stops when the * maxNumberOfRecursion in reached. */ - void jointDots(KDContext * ctx, KDRect rect, EvaluateModelWithParameter xEvaluation, EvaluateModelWithParameter yEvaluation, void * model, void * context, float x, float y, float u, float v, KDColor color, int maxNumberOfRecursion) const; + void jointDots(KDContext * ctx, KDRect rect, EvaluateModelWithParameter xEvaluation, EvaluateModelWithParameter yEvaluation, void * model, void * context, float t, float x, float y, float s, float u, float v, KDColor color, int maxNumberOfRecursion) const; /* Join two dots with a straight line. */ void straightJoinDots(KDContext * ctx, KDRect rect, float pxf, float pyf, float puf, float pvf, KDColor color) const; /* Stamp centered around (pxf, pyf). If pxf and pyf are not round number, the