tdf#147906 Use Math.hypot() for Pythagorean addition

Change-Id: I644947ca22f493bbc805c45334450db8d4b4808b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146137
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
This commit is contained in:
Yomnasalama
2023-02-06 18:32:36 +00:00
committed by Hossein
parent 52eba79371
commit 08cfcea7fe

View File

@ -426,7 +426,7 @@ class JavaPanZoomController
private float panDistance(MotionEvent move) {
float dx = mX.panDistance(move.getX(0));
float dy = mY.panDistance(move.getY(0));
return (float) Math.sqrt(dx * dx + dy * dy);
return (float) Math.hypot(dx , dy);
}
private void track(float x, float y, long time) {