|
@@ -5,6 +5,7 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
#include "EyesWidget.h"
|
|
#include "EyesWidget.h"
|
|
|
|
+#include <AK/StdLibExtraDetails.h>
|
|
#include <LibGUI/Painter.h>
|
|
#include <LibGUI/Painter.h>
|
|
#include <LibGUI/Window.h>
|
|
#include <LibGUI/Window.h>
|
|
#include <LibGUI/WindowServerConnection.h>
|
|
#include <LibGUI/WindowServerConnection.h>
|
|
@@ -89,14 +90,14 @@ Gfx::IntPoint EyesWidget::pupil_center(Gfx::IntRect& eyeball_bounds) const
|
|
double max_distance_along_this_direction;
|
|
double max_distance_along_this_direction;
|
|
|
|
|
|
// clang-format off
|
|
// clang-format off
|
|
- if (dx != 0 && abs(dx) >= abs(dy)) {
|
|
|
|
|
|
+ if (dx != 0 && AK::abs(dx) >= AK::abs(dy)) {
|
|
double slope = dy / dx;
|
|
double slope = dy / dx;
|
|
double slope_squared = slope * slope;
|
|
double slope_squared = slope * slope;
|
|
max_distance_along_this_direction = 0.25 * sqrt(
|
|
max_distance_along_this_direction = 0.25 * sqrt(
|
|
(slope_squared + 1) /
|
|
(slope_squared + 1) /
|
|
(1 / width_squared + slope_squared / height_squared)
|
|
(1 / width_squared + slope_squared / height_squared)
|
|
);
|
|
);
|
|
- } else if (dy != 0 && abs(dy) >= abs(dx)) {
|
|
|
|
|
|
+ } else if (dy != 0 && AK::abs(dy) >= AK::abs(dx)) {
|
|
double slope = dx / dy;
|
|
double slope = dx / dy;
|
|
double slope_squared = slope * slope;
|
|
double slope_squared = slope * slope;
|
|
max_distance_along_this_direction = 0.25 * sqrt(
|
|
max_distance_along_this_direction = 0.25 * sqrt(
|