mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
21 lines
352 B
C++
21 lines
352 B
C++
#pragma once
|
|
|
|
#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);
|
|
}
|
|
|
|
} // namespace util
|
|
} // namespace chatterino
|