summaryrefslogtreecommitdiffhomepage
path: root/spline-widget/spline-widget.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-10-29 15:49:49 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-10-29 15:51:20 +0200
commit031ef4c3b2ede47b30f69718fb1c0b9c4cfc1bf1 (patch)
tree84cd112c5126f7d47b7a4841ba8da287aed72d7b /spline-widget/spline-widget.cpp
parent224ab310a2866b8aed1fca8882a25f7a86314f0c (diff)
spline-widget: avoid sqrt in global namespace
Diffstat (limited to 'spline-widget/spline-widget.cpp')
-rw-r--r--spline-widget/spline-widget.cpp4
1 files changed, 2 insertions, 2 deletions
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)