From 2f7879555810b5b0650867735afceaa132ff5a2a Mon Sep 17 00:00:00 2001 From: iknowsomething <5054918+iknowsomething@users.noreply.github.com> Date: Mon, 18 Mar 2024 23:34:46 +0300 Subject: [PATCH] plugin-qeyes: fix pupil position when pointer is in the center of an eye --- plugin-qeyes/qeyeswidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin-qeyes/qeyeswidget.cpp b/plugin-qeyes/qeyeswidget.cpp index 9db035475..83a7b1764 100644 --- a/plugin-qeyes/qeyeswidget.cpp +++ b/plugin-qeyes/qeyeswidget.cpp @@ -117,13 +117,13 @@ void QAbstractEyesWidget::paintEvent(QPaintEvent *) { * if the cursor is inside the eye, the pupil position is * the cursor */ - if (y < 0 && dy < 0 && dy > y) + if (y <= 0 && dy <= 0 && dy > y) y = dy; - else if (y > 0 && dy > 0 && dy < y) + else if (y >= 0 && dy >= 0 && dy < y) y = dy; - if (x < 0 && dx < 0 && dx > x) + if (x <= 0 && dx <= 0 && dx > x) x = dx; - else if (x > 0 && dx > 0 && dx < x) + else if (x >= 0 && dx >= 0 && dx < x) x = dx; //painter.drawEllipse(QPoint(x0 + x, y0 + y), psize / 2, psize / 2);