summaryrefslogtreecommitdiffhomepage
path: root/pose-widget/pose-widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pose-widget/pose-widget.cpp')
-rw-r--r--pose-widget/pose-widget.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp
index 53bf214f..3ad475cf 100644
--- a/pose-widget/pose-widget.cpp
+++ b/pose-widget/pose-widget.cpp
@@ -38,7 +38,8 @@ void pose_widget::paintEvent(QPaintEvent*)
? back
: front;
- int w = img.width(), h = img.height();
+ constexpr double scale = .75;
+ int w = img.width(), h = iround(img.height()*scale);
QTransform t;
@@ -47,15 +48,15 @@ void pose_widget::paintEvent(QPaintEvent*)
constexpr double z_scale = 1./250;
constexpr double xy_scale = .0075;
double xy = std::sqrt(w*w + h*h) * xy_scale;
+ double sx = clamp(.4 + -z * z_scale, .1, 2), sy = sx * 1/scale;
- double s = clamp(.4 + -z * z_scale, .1, 2);
- t.scale(s, s);
+ t.scale(sx, sy);
t.rotate(pitch, Qt::XAxis);
t.rotate(yaw, Qt::YAxis);
t.rotate(roll, Qt::ZAxis);
- t.translate(x * xy / s, y * xy / s);
+ t.translate(x * xy / sx, y * xy / sy);
t.translate(w*-.5, h*-.5);