diff --git a/native/jni/src/proximity_info_state.cpp b/native/jni/src/proximity_info_state.cpp index 0bb6dd9cb3169bb1fbb77fa2a600a22b1966024c..422068db2d78be6f0a1b27af4632cb8201c21b17 100644 --- a/native/jni/src/proximity_info_state.cpp +++ b/native/jni/src/proximity_info_state.cpp @@ -25,7 +25,7 @@ #include "proximity_info_state.h" namespace latinime { -void ProximityInfoState::initInputParams(const int pointerId, const float maxLength, +void ProximityInfoState::initInputParams(const int pointerId, const float maxPointToKeyLength, const ProximityInfo *proximityInfo, const int32_t *inputCodes, const int inputSize, const int *const xCoordinates, const int *const yCoordinates, const int *const times, const int *const pointerIds, const bool isGeometric) { @@ -68,7 +68,7 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxLen } } - mMaxPointToKeyLength = maxLength; + mMaxPointToKeyLength = maxPointToKeyLength; /////////////////////// // Setup touch points mInputXs.clear(); @@ -115,8 +115,8 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxLen } mPrimaryInputWord[inputSize] = 0; - mTouchPositionCorrectionEnabled = - mHasTouchPositionCorrectionData && xCoordinates && yCoordinates && !isGeometric; + mTouchPositionCorrectionEnabled = mInputSize > 0 && mHasTouchPositionCorrectionData + && xCoordinates && yCoordinates && !isGeometric; for (int i = 0; i < mInputSize && mTouchPositionCorrectionEnabled; ++i) { const int *proximityChars = getProximityCharsAt(i); const int primaryKey = proximityChars[0]; diff --git a/native/jni/src/proximity_info_state.h b/native/jni/src/proximity_info_state.h index 81d68fdcbf90f69d401379bb5767f2efb374c1fc..1780004467172792918229c850f09f1e2c6d3350 100644 --- a/native/jni/src/proximity_info_state.h +++ b/native/jni/src/proximity_info_state.h @@ -41,7 +41,7 @@ class ProximityInfoState { ///////////////////////////////////////// // Defined in proximity_info_state.cpp // ///////////////////////////////////////// - void initInputParams(const int pointerId, const float maxLength, + void initInputParams(const int pointerId, const float maxPointToKeyLength, const ProximityInfo *proximityInfo, const int32_t *inputCodes, const int inputSize, const int *xCoordinates, const int *yCoordinates, const int *const times, const int *const pointerIds, const bool isGeometric);