From 031ef4c3b2ede47b30f69718fb1c0b9c4cfc1bf1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 29 Oct 2016 15:49:49 +0200 Subject: spline-widget: avoid sqrt in global namespace --- spline-widget/spline-widget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spline-widget/spline-widget.cpp') diff --git a/spline-widget/spline-widget.cpp b/spline-widget/spline-widget.cpp index 47ae6fdd..6c51c2a2 100644 --- a/spline-widget/spline-widget.cpp +++ b/spline-widget/spline-widget.cpp @@ -519,8 +519,8 @@ void spline_widget::update_range() bool spline_widget::point_within_pixel(const QPointF& pt, const QPoint &pixel) { - QPointF tmp = pixel - point_to_pixel(pt); - return sqrt(QPointF::dotProduct(tmp, tmp)) < point_size; + const QPointF tmp = pixel - point_to_pixel(pt); + return QPointF::dotProduct(tmp, tmp) < point_size * point_size; } void spline_widget::focusOutEvent(QFocusEvent* e) -- cgit v1.2.3