[Scummvm-git-logs] scummvm master -> 78ee37a1e305fa516d88089f7165271ff0cdb9a6
tag2015
noreply at scummvm.org
Tue Jul 30 14:02:35 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
78ee37a1e3 AGS: Common: fixed wrong calculation in DistanceBetween()
Commit: 78ee37a1e305fa516d88089f7165271ff0cdb9a6
https://github.com/scummvm/scummvm/commit/78ee37a1e305fa516d88089f7165271ff0cdb9a6
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2024-07-30T16:02:00+02:00
Commit Message:
AGS: Common: fixed wrong calculation in DistanceBetween()
>From upstream c5f8c5374024b71493d276a27daa38d1aac84a89
Fix #15292
Changed paths:
engines/ags/shared/util/geometry.cpp
diff --git a/engines/ags/shared/util/geometry.cpp b/engines/ags/shared/util/geometry.cpp
index 1806ead3577..b7590b7ace2 100644
--- a/engines/ags/shared/util/geometry.cpp
+++ b/engines/ags/shared/util/geometry.cpp
@@ -45,7 +45,7 @@ float DistanceBetween(const Rect &r1, const Rect &r2) {
);
int inner_width = MAX(0, rect_outer.GetWidth() - r1.GetWidth() - r2.GetWidth());
int inner_height = MAX(0, rect_outer.GetHeight() - r1.GetHeight() - r2.GetHeight());
- return static_cast<float>(std::sqrt((inner_width ^ 2) + (inner_height ^ 2)));
+ return static_cast<float>(std::sqrt((inner_width * inner_width) + (inner_height * inner_height)));
}
Size ProportionalStretch(int dest_w, int dest_h, int item_w, int item_h) {
More information about the Scummvm-git-logs
mailing list