Loading core/java/android/view/MotionEvent.java +15 −5 Original line number Diff line number Diff line Loading @@ -1656,13 +1656,21 @@ public final class MotionEvent extends InputEvent implements Parcelable { } /** * Scales down the coordination of this event by the given scale. * Applies a scale factor to all points within this event. * * This method is used to adjust touch events to simulate different density * displays for compatibility mode. The values returned by {@link #getRawX()}, * {@link #getRawY()}, {@link #getXPrecision()} and {@link #getYPrecision()} * are also affected by the scale factor. * * @param scale The scale factor to apply. * @hide */ public final void scale(float scale) { if (scale != 1.0f) { nativeScale(mNativePtr, scale); } } /** {@inheritDoc} */ @Override Loading Loading @@ -2631,8 +2639,10 @@ public final class MotionEvent extends InputEvent implements Parcelable { * @param deltaY Amount to add to the current Y coordinate of the event. */ public final void offsetLocation(float deltaX, float deltaY) { if (deltaX != 0.0f || deltaY != 0.0f) { nativeOffsetLocation(mNativePtr, deltaX, deltaY); } } /** * Set this event's location. Applies {@link #offsetLocation} with a Loading @@ -2644,7 +2654,7 @@ public final class MotionEvent extends InputEvent implements Parcelable { public final void setLocation(float x, float y) { float oldX = getX(); float oldY = getY(); nativeOffsetLocation(mNativePtr, x - oldX, y - oldY); offsetLocation(x - oldX, y - oldY); } /** Loading Loading
core/java/android/view/MotionEvent.java +15 −5 Original line number Diff line number Diff line Loading @@ -1656,13 +1656,21 @@ public final class MotionEvent extends InputEvent implements Parcelable { } /** * Scales down the coordination of this event by the given scale. * Applies a scale factor to all points within this event. * * This method is used to adjust touch events to simulate different density * displays for compatibility mode. The values returned by {@link #getRawX()}, * {@link #getRawY()}, {@link #getXPrecision()} and {@link #getYPrecision()} * are also affected by the scale factor. * * @param scale The scale factor to apply. * @hide */ public final void scale(float scale) { if (scale != 1.0f) { nativeScale(mNativePtr, scale); } } /** {@inheritDoc} */ @Override Loading Loading @@ -2631,8 +2639,10 @@ public final class MotionEvent extends InputEvent implements Parcelable { * @param deltaY Amount to add to the current Y coordinate of the event. */ public final void offsetLocation(float deltaX, float deltaY) { if (deltaX != 0.0f || deltaY != 0.0f) { nativeOffsetLocation(mNativePtr, deltaX, deltaY); } } /** * Set this event's location. Applies {@link #offsetLocation} with a Loading @@ -2644,7 +2654,7 @@ public final class MotionEvent extends InputEvent implements Parcelable { public final void setLocation(float x, float y) { float oldX = getX(); float oldY = getY(); nativeOffsetLocation(mNativePtr, x - oldX, y - oldY); offsetLocation(x - oldX, y - oldY); } /** Loading