Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eac45b8a authored by Jeff Brown's avatar Jeff Brown Committed by Android Git Automerger
Browse files

am ed4d28dd: Add method to apply offset to PointerCoords. (DO NOT MERGE)

* commit 'ed4d28dd':
  Add method to apply offset to PointerCoords.  (DO NOT MERGE)
parents 6e5fdb15 ed4d28dd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -184,6 +184,7 @@ struct PointerCoords {
    status_t setAxisValue(int32_t axis, float value);

    void scale(float scale);
    void applyOffset(float xOffset, float yOffset);

    inline float getX() const {
        return getAxisValue(AMOTION_EVENT_AXIS_X);
+5 −0
Original line number Diff line number Diff line
@@ -213,6 +213,11 @@ void PointerCoords::scale(float scaleFactor) {
    scaleAxisValue(*this, AMOTION_EVENT_AXIS_TOOL_MINOR, scaleFactor);
}

void PointerCoords::applyOffset(float xOffset, float yOffset) {
    setAxisValue(AMOTION_EVENT_AXIS_X, getX() + xOffset);
    setAxisValue(AMOTION_EVENT_AXIS_Y, getY() + yOffset);
}

#ifdef HAVE_ANDROID_OS
status_t PointerCoords::readFromParcel(Parcel* parcel) {
    bits = parcel->readInt64();