mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 23:00:45 +01:00
[apps/*/curve_view] Use drawCartesianCurve specifically for drawing Cartesian curves
This commit is contained in:
committed by
Léa Saviot
parent
7d689e22e4
commit
fbee2d81e4
@@ -28,7 +28,7 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ExpiringPointer<CartesianFunction> f = m_functionStore->modelForRecord(record);;
|
||||
|
||||
/* Draw function */
|
||||
drawCurve(ctx, rect, [](float t, void * model, void * context) {
|
||||
drawCartesianCurve(ctx, rect, [](float t, void * model, void * context) {
|
||||
CartesianFunction * f = (CartesianFunction *)model;
|
||||
Poincare::Context * c = (Poincare::Context *)context;
|
||||
return f->evaluateAtAbscissa(t, c);
|
||||
@@ -39,7 +39,7 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
float tangentParameter[2];
|
||||
tangentParameter[0] = f->approximateDerivative(m_curveViewCursor->x(), context());
|
||||
tangentParameter[1] = -tangentParameter[0]*m_curveViewCursor->x()+f->evaluateAtAbscissa(m_curveViewCursor->x(), context());
|
||||
drawCurve(ctx, rect, [](float t, void * model, void * context) {
|
||||
drawCartesianCurve(ctx, rect, [](float t, void * model, void * context) {
|
||||
float * tangent = (float *)model;
|
||||
return tangent[0]*t+tangent[1];
|
||||
}, tangentParameter, nullptr, Palette::GreyVeryDark);
|
||||
|
||||
Reference in New Issue
Block a user