mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] Default integral has 'dx' and cursor skips dx when moving
towards right
This commit is contained in:
@@ -13,7 +13,7 @@ using namespace Poincare;
|
||||
|
||||
const ToolboxMessageTree calculChildren[4] = {
|
||||
ToolboxMessageTree(I18n::Message::DiffCommandWithArg, I18n::Message::DerivateNumber, I18n::Message::DiffCommandWithArg),
|
||||
ToolboxMessageTree(I18n::Message::IntCommandWithArg, I18n::Message::Integral, I18n::Message::IntCommandWithArg),
|
||||
ToolboxMessageTree(I18n::Message::IntCommandWithArg, I18n::Message::Integral, I18n::Message::IntCommand),
|
||||
ToolboxMessageTree(I18n::Message::SumCommandWithArg, I18n::Message::Sum, I18n::Message::SumCommandWithArg),
|
||||
ToolboxMessageTree(I18n::Message::ProductCommandWithArg, I18n::Message::Product, I18n::Message::ProductCommandWithArg)};
|
||||
|
||||
@@ -115,14 +115,18 @@ bool MathToolbox::selectLeaf(int selectedRow) {
|
||||
ToolboxMessageTree * messageTree = (ToolboxMessageTree *)m_messageTreeModel->children(selectedRow);
|
||||
m_selectableTableView.deselectTable();
|
||||
|
||||
// Translate the message and remove the arguments
|
||||
// Translate the message
|
||||
const char * text = I18n::translate(messageTree->insertedText());
|
||||
int maxTextToInsertLength = strlen(text) + 1;
|
||||
assert(maxTextToInsertLength <= k_maxMessageSize);
|
||||
char textToInsert[k_maxMessageSize];
|
||||
Shared::ToolboxHelpers::TextToInsertForCommandText(text, textToInsert, maxTextToInsertLength, true);
|
||||
if (messageTree->label() == messageTree->insertedText()) {
|
||||
// Remove the arguments if we kept one message for both inserted and displayed message
|
||||
int maxTextToInsertLength = strlen(text) + 1;
|
||||
assert(maxTextToInsertLength <= k_maxMessageSize);
|
||||
char textToInsert[k_maxMessageSize];
|
||||
Shared::ToolboxHelpers::TextToInsertForCommandText(text, textToInsert, maxTextToInsertLength, true);
|
||||
text = textToInsert;
|
||||
}
|
||||
|
||||
sender()->handleEventWithText(textToInsert);
|
||||
sender()->handleEventWithText(text);
|
||||
app()->dismissModalViewController();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ FloorCommandWithArg = "floor(x)"
|
||||
FracCommandWithArg = "frac(x)"
|
||||
GcdCommandWithArg = "gcd(p,q)"
|
||||
ImCommandWithArg = "im(z)"
|
||||
IntCommand = "int(ø,x,ø,ø)"
|
||||
IntCommandWithArg = "int(f(x),x,a,b)"
|
||||
InverseCommandWithArg = "inverse(M)"
|
||||
InvSortCommandWithArg = "sort>(L)"
|
||||
|
||||
@@ -76,9 +76,9 @@ void IntegralLayoutNode::moveCursorRight(LayoutCursor * cursor, bool * shouldRec
|
||||
if (cursor->layoutNode() == integrandLayout())
|
||||
{
|
||||
assert(cursor->position() == LayoutCursor::Position::Right);
|
||||
// Case: Right the integrand. Go right of the differential.
|
||||
cursor->setLayoutNode(differentialLayout());
|
||||
cursor->setPosition(LayoutCursor::Position::Left);
|
||||
// Case: Right the differential. Go Right.
|
||||
cursor->setLayoutNode(this);
|
||||
cursor->setPosition(LayoutCursor::Position::Right);
|
||||
return;
|
||||
}
|
||||
if (cursor->layoutNode() == differentialLayout())
|
||||
|
||||
Reference in New Issue
Block a user