diff options
author | 2013-04-11 12:44:15 +0900 | |
---|---|---|
committer | 2013-04-15 19:10:27 +0900 | |
commit | 837f46dcb35a8f42a6bd5bc5fc6395d7386acb81 (patch) | |
tree | 91a17cee7ac752540c5abc3ac1a973fa2e676e16 /native/jni/src/proximity_info_state.cpp | |
parent | 059e084e983ce4a1440dc065f5167d278d8939e7 (diff) | |
download | latinime-837f46dcb35a8f42a6bd5bc5fc6395d7386acb81.tar.gz latinime-837f46dcb35a8f42a6bd5bc5fc6395d7386acb81.tar.xz latinime-837f46dcb35a8f42a6bd5bc5fc6395d7386acb81.zip |
Enable touch coordinate correction for new algorithm
Bug: 8505668
Change-Id: I07eb785c74c446777524104a3d2b61f0f591a498
Diffstat (limited to 'native/jni/src/proximity_info_state.cpp')
-rw-r--r-- | native/jni/src/proximity_info_state.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/native/jni/src/proximity_info_state.cpp b/native/jni/src/proximity_info_state.cpp index a10b260e1..cc5b736bd 100644 --- a/native/jni/src/proximity_info_state.cpp +++ b/native/jni/src/proximity_info_state.cpp @@ -81,7 +81,7 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi mSampledTimes.clear(); mSampledInputIndice.clear(); mSampledLengthCache.clear(); - mSampledDistanceCache_G.clear(); + mSampledNormalizedSquaredLengthCache.clear(); mSampledNearKeySets.clear(); mSampledSearchKeySets.clear(); mSpeedRates.clear(); @@ -122,14 +122,15 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi if (mSampledInputSize > 0) { ProximityInfoStateUtils::initGeometricDistanceInfos(mProximityInfo, mSampledInputSize, lastSavedInputSize, verticalSweetSpotScale, &mSampledInputXs, &mSampledInputYs, - &mSampledNearKeySets, &mSampledDistanceCache_G); + &mSampledNearKeySets, &mSampledNormalizedSquaredLengthCache); if (isGeometric) { // updates probabilities of skipping or mapping each key for all points. ProximityInfoStateUtils::updateAlignPointProbabilities( mMaxPointToKeyLength, mProximityInfo->getMostCommonKeyWidth(), mProximityInfo->getKeyCount(), lastSavedInputSize, mSampledInputSize, &mSampledInputXs, &mSampledInputYs, &mSpeedRates, &mSampledLengthCache, - &mSampledDistanceCache_G, &mSampledNearKeySets, &mCharProbabilities); + &mSampledNormalizedSquaredLengthCache, &mSampledNearKeySets, + &mCharProbabilities); ProximityInfoStateUtils::updateSampledSearchKeySets(mProximityInfo, mSampledInputSize, lastSavedInputSize, &mSampledLengthCache, &mSampledNearKeySets, &mSampledSearchKeySets, @@ -171,7 +172,7 @@ float ProximityInfoState::getPointToKeyLength( const int keyId = mProximityInfo->getKeyIndexOf(codePoint); if (keyId != NOT_AN_INDEX) { const int index = inputIndex * mProximityInfo->getKeyCount() + keyId; - return min(mSampledDistanceCache_G[index], mMaxPointToKeyLength); + return min(mSampledNormalizedSquaredLengthCache[index], mMaxPointToKeyLength); } if (isIntentionalOmissionCodePoint(codePoint)) { return 0.0f; @@ -183,7 +184,8 @@ float ProximityInfoState::getPointToKeyLength( float ProximityInfoState::getPointToKeyByIdLength( const int inputIndex, const int keyId) const { return ProximityInfoStateUtils::getPointToKeyByIdLength(mMaxPointToKeyLength, - &mSampledDistanceCache_G, mProximityInfo->getKeyCount(), inputIndex, keyId); + &mSampledNormalizedSquaredLengthCache, mProximityInfo->getKeyCount(), inputIndex, + keyId); } // In the following function, c is the current character of the dictionary word currently examined. |