aboutsummaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-11-17 15:46:32 +0900
committersatok <satok@google.com>2011-11-17 15:56:41 +0900
commit554fdd21a1ec0058cdf5e697f2be6dd29d7eb31b (patch)
tree9f7c1de751188932c4b0427746f5d1bf01772ae8 /native/src
parent2549ce275a272d552c28121ea58742e54b640e54 (diff)
downloadlatinime-554fdd21a1ec0058cdf5e697f2be6dd29d7eb31b.tar.gz
latinime-554fdd21a1ec0058cdf5e697f2be6dd29d7eb31b.tar.xz
latinime-554fdd21a1ec0058cdf5e697f2be6dd29d7eb31b.zip
Fix the touch calibration bug
Bug: 5629373 Change-Id: Iacc746e1cc97bf305e1f287cf7431b7115607eeb
Diffstat (limited to 'native/src')
-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);