fixed message cursor positions

This commit is contained in:
fourtf
2017-04-24 23:00:26 +02:00
parent eb82f5c1e2
commit 95c7ae9f18
6 changed files with 230 additions and 228 deletions
+22
View File
@@ -0,0 +1,22 @@
#ifndef DISTANCEBETWEENPOINTS_H
#define DISTANCEBETWEENPOINTS_H
#include <math.h>
namespace chatterino {
namespace util {
static float distanceBetweenPoints(const QPointF &p1, const QPointF &p2)
{
QPointF tmp = p1 - p2;
float distance = 0.f;
distance += tmp.x() * tmp.x();
distance += tmp.y() * tmp.y();
return sqrt(distance);
}
}
}
#endif // DISTANCEBETWEENPOINTS_H