Commit Graph

10444 Commits

Author SHA1 Message Date
Léa Saviot
e4601206be [poincare/power] Fix getUnit -> return Undef if base has undef unit 2020-02-12 15:13:25 +01:00
Léa Saviot
2527f30429 [poincare] Beware of units in "difficult" shallowReduces - Power 2020-02-12 15:13:25 +01:00
Léa Saviot
e1a7dcdb13 [poincare] Beware of units in "difficult" shallowReduces - Addition 2020-02-12 15:13:25 +01:00
Léa Saviot
b93277bb7b [poincare/test] Fix tests
Unparsable tests are now parsable but return undef at the simplification
2020-02-12 15:13:25 +01:00
Léa Saviot
d5b07f1f90 [poincare] Implemment getUnit 2020-02-12 15:13:25 +01:00
Léa Saviot
94334169f0 [poincare/expr] Remove beautifiedExpHasUnits and reducedExpIsUnitsOnly 2020-02-12 15:13:25 +01:00
Léa Saviot
ecdcb100fb [poincare/unit_convert] Fix UnitConvert::shallowReduce 2020-02-12 15:13:25 +01:00
Léa Saviot
d98eddf960 [poincare/parser] UnitConvert does not check the right member is a unit 2020-02-12 15:13:25 +01:00
Émilie Feral
9dbb1153a1 [escher] Add TODOs on EditableField, InputEventHandler, LayoutField,
TextInput, TextArea, TextInput
2020-02-12 15:13:25 +01:00
Émilie Feral
9c25fdb66e [escher] TextField: fix shouldFinishEditing to reset selection 2020-02-12 15:13:25 +01:00
Émilie Feral
2470821a6b [apps/settings] Fix sub controller viewWillAppear /
didEnterResponderChain behaviours

This fixes the following bug: when editing the number of significant
digits, input "1+", click on "OK", the data was reloaded and "1+"
disappeared...
2020-02-12 15:13:25 +01:00
Émilie Feral
4e6411e4a5 [poincare] Unit: missing include for device build 2020-02-12 15:13:25 +01:00
Ruben Dashyan
3aea607be2 [poincare] Force Float(1) in front of an orphan (Power of) Unit 2020-02-12 15:13:25 +01:00
Ruben Dashyan
d8e36e3cf1 [poincare/test/simplification] Fix units' tests 2020-02-12 15:13:25 +01:00
Ruben Dashyan
907bd0db62 [poincare/test/simplification] Fix typo 2020-02-12 15:13:25 +01:00
Ruben Dashyan
30fb27d36a [poincare/test/simplification] Add tests on Units 2020-02-12 15:13:25 +01:00
Léa Saviot
16a832507e [emscripten/whitelist] Whitelist some methods 2020-02-12 15:13:25 +01:00
Émilie Feral
533f1312db [solver] Add test with 6 variables 2020-02-12 15:13:25 +01:00
Émilie Feral
3df80ed780 [poincare] ParameteredExpression: overrides getVariables to avoid
considering parameter as a variable
2020-02-12 15:13:25 +01:00
Léa Saviot
b8f65442db [ion/simulator] Keyboard shift + left/right/up/down now works 2020-02-12 15:13:25 +01:00
Émilie Feral
5cb26b19a5 [poincare] Parsing: Unit token does not accept '_' char except at first
position. This enables to parse "_km_s" as Multiplication(Unit(km),
Unit(s))
2020-02-12 15:13:25 +01:00
Émilie Feral
f91ca59ca3 [poincare] Test: call Expression::Parse instead of creating a parser
object everytime we need to parse something
2020-02-12 15:13:24 +01:00
Léa Saviot
5afb49c85d [poincare] Rename RightArrow -> RightwardsArrow 2020-02-12 15:13:24 +01:00
Léa Saviot
83ea9cf1e1 [poincare/parser] Rename Store with RightwardsArrow 2020-02-12 15:13:24 +01:00
Léa Saviot
7a65e5180b [poincare/right_arrow_expression] Factorize Store and UnivtConvert 2020-02-12 15:13:24 +01:00
Léa Saviot
8a0e5403ae [poincare/test] Add unit conversion tests 2020-02-12 15:13:24 +01:00
Ruben Dashyan
657ae5ff63 [poincare/unit] Fix shallowBeautify
Expressions with Units inside an Opposite were beautifed as Undefined
2020-02-12 15:13:24 +01:00
Ruben Dashyan
22e22b8123 [poincare/tree_handle] Make sure B has the same parent as A after A.replaceWithInPlace(B)
Even when A has no parent, B should be detached from its old parent.
2020-02-12 15:13:24 +01:00
Léa Saviot
4651f7ef0d [poincare/expression] Fix simplifyAndApproximate with convertUnit 2020-02-12 15:13:24 +01:00
Émilie Feral
1484dbc5d4 [poincare] Multiplication::shallowReduce: simplify implementation!
(recursivelyMatches all children is equivalent to recursivelyMatches on
the current node)
2020-02-12 15:13:24 +01:00
Émilie Feral
ff438cbea8 [poincare] Multiplication::shallowReduce: don't apply 0*a --> 0 when a
involves unit or infinity
2020-02-12 15:13:24 +01:00
Émilie Feral
ee1224dd95 [poincare] Multiplication::shallowBeautify: Keep the unit when the value
is 0 or undefined, add tests
2020-02-12 15:13:24 +01:00
Émilie Feral
879843ce2b [escher] LayoutField: reset selection when the field should finish
editing

This fixes the following bug: in solver, input Matrix(Matrix()) and select the
inner Matrix. When handling "OK" event, the "=0" is inserted at a wrong
position leading to a crash !
2020-02-12 15:13:24 +01:00
Ruben Dashyan
2ae435a628 [apps/calculation/calculation] Remove redundancy
When each Calculation had its own text buffer, the Expression of an
overflowing output text was Undefined. Hence that Expression could have
been Undefined without the corresponding text being 'undef'. That situation
may not happen anymore since Calculation are stored in a shared buffer.
2020-02-12 15:13:24 +01:00
Léa Saviot
cb119b796a [poincare/symbol] Use flag RplceAllSymbolsWithUndefAndDoNotRplceUnits 2020-02-12 15:13:24 +01:00
Léa Saviot
c543985094 [poincare] Unit conversion 2020-02-12 15:13:24 +01:00
Ruben Dashyan
1393e5e973 [apps/calculation/calculation] Rearrange the conditions forcing DisplayOutput::ApproximateOnly 2020-02-12 15:13:24 +01:00
Ruben Dashyan
46a5a7cf5c [apps/calculation/calculation] Force DisplayOutput::ApproximateOnly when there is Unit
The most common case where only the approximate output is displayed
happens when the exact and the approximate outputs are equal, more
precisely when the exact output is equal to the approximate output with
the number of significant digits taken from user settings. That
clarification matters for the Poincare::Integers which have more digits than
the number of significant digits set by the user.

Besides, an Expression containing Units is simplified as
Multiplication(Float, Unit...) recorded identically into the exact and
the approximate outputs (except perhaps the number of significant
digits). Generally, the case where the number of digits in the output is
smaller or equal to the user setting would be matched by the condition,
stated above, that exact and approximate output are equal. But that
should also be the case whatever the number of significant digits. That
is why the presence of Units is matched specifically.
2020-02-12 15:13:24 +01:00
Émilie Feral
4bcb3283c2 [escher] TextField: handleEventWithText: don't move the cursor position
if the text could not be inserted
2020-02-12 15:13:24 +01:00
Émilie Feral
0ffcf34eb7 [escher] TextField: make the handleEventWithText behaviour consistent:
when a text cannot be inserted because it overflows the buffer, don't
add anything

insertTextAtLocation already behaves like this but handleEventWithText
used to cap the inserted text which sometimes leads to a different
behaviour - it would insert a truncated text
2020-02-12 15:13:24 +01:00
Émilie Feral
0c55ea4531 [ion] unicode: UTF8Helper::CopyAndRemoveCodePoints returns a boolean
which is true if the whole source was copied
2020-02-12 15:13:24 +01:00
Ruben Dashyan
0a61e0f7bc [apps/shared/round_cursor_view] Add warning about getPixels 2020-02-12 15:13:24 +01:00
Ruben Dashyan
8d3f86c77f [kandinsky/context] getPixel only if in the clipping rect
Fixes the redrawing of RoundCursorView when its frame overlaps the
clipping rect.
2020-02-12 15:13:24 +01:00
Ruben Dashyan
7b8f7007c4 [kandinsky/context] Inline in header file 2020-02-12 15:13:24 +01:00
Ruben Dashyan
63424fb98b [apps/*/function_graph_controller] Factor selectFunctionWithCursor 2020-02-12 15:13:24 +01:00
Ruben Dashyan
246a9aa7a4 [apps/shared/function_graph_controller] Clarify function selection in initCursorParameters 2020-02-12 15:13:24 +01:00
Ruben Dashyan
1cdd61ea47 [apps/shared/function_graph_controller] Do not compute the numberOfActiveFunctions repeatedly 2020-02-12 15:13:24 +01:00
Ruben Dashyan
503a9ed128 [apps/shared/round_cursor_view] Fix GRAPH_CURSOR_SPEEDUP macro usage 2020-02-12 15:13:24 +01:00
Émilie Feral
9d1a5ea0a8 [escher] LayoutField: fix putCursorRightOfLayout to update matrix
layouts if necessary
2020-02-12 15:13:24 +01:00
Émilie Feral
18b4514412 [python] port: add a comment abouth how we use setjmp 2020-02-12 15:13:24 +01:00