mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 01:00:50 +01:00
[curve_view] Add double evaluation
Add the possibility to use a double-typed evaluator when tracing a curve, useful when errors caused by float approximation mess with the drawing. Change-Id: I3ab410deec4823149239b0a26b1885fd2a493226
This commit is contained in:
committed by
LeaNumworks
parent
c91c2a6e3f
commit
106916e7bf
@@ -57,7 +57,12 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ContinuousFunction * f = (ContinuousFunction *)model;
|
||||
Poincare::Context * c = (Poincare::Context *)context;
|
||||
return f->evaluateXYAtParameter(t, c);
|
||||
}, f.operator->(), context(), f->color(), true, record == m_selectedRecord, m_highlightedStart, m_highlightedEnd);
|
||||
}, f.operator->(), context(), f->color(), true, record == m_selectedRecord, m_highlightedStart, m_highlightedEnd,
|
||||
[](double t, void * model, void * context) {
|
||||
ContinuousFunction * f = (ContinuousFunction *)model;
|
||||
Poincare::Context * c = (Poincare::Context *)context;
|
||||
return f->evaluateXYAtParameter(t, c);
|
||||
});
|
||||
/* Draw tangent */
|
||||
if (m_tangent && record == m_selectedRecord) {
|
||||
float tangentParameterA = f->approximateDerivative(m_curveViewCursor->x(), context());
|
||||
|
||||
Reference in New Issue
Block a user