aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-11-16 23:25:13 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-16 23:25:13 -0800
commitb39355e1972b08cae42977d0251690dab5fcc813 (patch)
treeec5498766b06f85ea2885ea29dd31fea02c7bbd1
parent81632b74387855f4a23b50c6e5e48ee016e3759a (diff)
parent620b1faf126d4b5f7cb5c353cebd374d1347fdd4 (diff)
downloadlatinime-b39355e1972b08cae42977d0251690dab5fcc813.tar.gz
latinime-b39355e1972b08cae42977d0251690dab5fcc813.tar.xz
latinime-b39355e1972b08cae42977d0251690dab5fcc813.zip
am 620b1faf: Merge "Fix the touch calibration bug" into ics-mr1
* commit '620b1faf126d4b5f7cb5c353cebd374d1347fdd4': Fix the touch calibration bug
-rw-r--r--native/src/correction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/native/src/correction.cpp b/native/src/correction.cpp
index 0c566802c..27dc40745 100644
--- a/native/src/correction.cpp
+++ b/native/src/correction.cpp
@@ -758,6 +758,9 @@ int Correction::RankingAlgorithm::calculateFinalFreq(const int inputIndex, const
// \ .
// C \ .
// 0 R1 R2
+ if (factor <= 0) {
+ return -1;
+ }
multiplyRate((int)(factor * 100), &finalFreq);
} else if (squaredDistance == PROXIMITY_CHAR_WITHOUT_DISTANCE_INFO) {
multiplyRate(WORDS_WITH_PROXIMITY_CHARACTER_DEMOTION_RATE, &finalFreq);