mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/calculation] Raise exception if row height miscomputed
Scenario: Put the complex mode to exponential, then go back to Calculation and: Toolbox, Down, Down, Down, Down, OK, OK, Two, Plus, Imaginary, Toolbox, Down, Down, Down, Down, OK, Down, OK, Two, Plus, Imaginary, OK, Toolbox, Down, Down, Down, Down, Down, OK, Down, OK, Up, OK, Right, Zero, OK, OK, Toolbox, Down, Down, OK, Toolbox, Back, Up, Zero, Up, OK, Zero, Up, Up, Up
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "history_controller.h"
|
||||
#include "app.h"
|
||||
#include <poincare/exception_checkpoint.h>
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Shared;
|
||||
@@ -206,6 +207,10 @@ KDCoordinate HistoryController::rowHeight(int j) {
|
||||
KDCoordinate result = calculation->memoizedHeight(expanded);
|
||||
if (result < 0) {
|
||||
result = HistoryViewCell::Height(calculation.pointer(), expanded);
|
||||
if (result < 0) {
|
||||
// Raise, because Height modified the calculation and failed.
|
||||
Poincare::ExceptionCheckpoint::Raise();
|
||||
}
|
||||
calculation->setMemoizedHeight(expanded, result);
|
||||
}
|
||||
/* We might want to put an assertion here to check the memoization:
|
||||
|
||||
Reference in New Issue
Block a user