Permalink
Browse files

dont graph matrices

  • Loading branch information...
1 parent 64f1a8b commit 9f559846c113e528a21f56ad1079925b6d30232c @Xlythe committed Feb 5, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/com/android2/calculator3/Logic.java
View
11 src/com/android2/calculator3/Logic.java
@@ -240,11 +240,18 @@ void onEnter() {
}
}
- public void evaluateAndShowResult(String text, Scroll scroll) {
+ private boolean displayContainsMatrices() {
boolean containsMatrices = false;
for(int i = 0; i < mDisplay.getAdvancedDisplay().getChildCount(); i++) {
if(mDisplay.getAdvancedDisplay().getChildAt(i) instanceof MatrixView) containsMatrices = true;
+ if(mDisplay.getAdvancedDisplay().getChildAt(i) instanceof MatrixInverseView) containsMatrices = true;
+ if(mDisplay.getAdvancedDisplay().getChildAt(i) instanceof MatrixTransposeView) containsMatrices = true;
}
+ return containsMatrices;
+ }
+
+ public void evaluateAndShowResult(String text, Scroll scroll) {
+ boolean containsMatrices = displayContainsMatrices();
try {
String result;
if(containsMatrices) result = evaluateMatrices(mDisplay.getAdvancedDisplay());
@@ -483,7 +490,7 @@ void updateGraph(final Graph g) {
return;
}
- if(isOperator(eq.charAt(eq.length() - 1))) return;
+ if(isOperator(eq.charAt(eq.length() - 1)) || displayContainsMatrices()) return;
final String[] equation = eq.split("=");

0 comments on commit 9f55984

Please sign in to comment.