To get more precise distincion for re-touch points,
shape of decision region need to change to circular from rectangle.
It makes reduce a gap between mouse event area(decision region)
and point appearance.
Change-Id: I6e47a0d3a8c1bd45ba0df124cf744573fffe41dd
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
*
*/
-#include <QWidget>
-#include <QPainter>
-#include <QImage>
-#include <QDebug>
+#include <QtWidgets>
#include "qt5_supplement.h"
#include "multitouchtracker.h"
targetPos.x() < point->getHostPos().x() + pointRadius &&
targetPos.y() >= point->getHostPos().y() - pointRadius &&
targetPos.y() < point->getHostPos().y() + pointRadius) {
- return point;
+
+ /* more precise distinction with circular region */
+ qreal distance = qSqrt(
+ qPow(targetPos.x() - point->getHostPos().x(), 2) +
+ qPow(targetPos.y() - point->getHostPos().y(), 2));
+ if (distance <= pointRadius) {
+ return point;
+ }
}
}
}