refactoring/cleanups

This commit is contained in:
2018-07-30 20:56:17 +02:00
parent 9a07790ec6
commit a9fcb77675
23 changed files with 276 additions and 247 deletions

View File

@@ -154,7 +154,7 @@ void Painter::drawImage(const Point2 pt, const QImage& img) {
void Painter::drawLength(Point2 p1, Point2 p2, const float len, const float offset) {
if (p1.x < p2.x) {swap(p1, p2);}
const Point2 center_m = (p1 + p2) / 2;
const Point2 center_m = (p1 + p2) / 2 - Point2(0.5,0);
Point2 dir_px = (p2 - p1).perpendicular().normalized() * (5+offset);
if (dir_px.x <= 0) {dir_px = -dir_px;}
const Point2 pos_m = center_m + dir_px / getScaler().getScale();