summaryrefslogtreecommitdiffhomepage
path: root/pose-widget
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2020-02-03 21:47:45 +0100
committerStanislaw Halik <sthalik@misaki.pl>2020-02-03 21:47:45 +0100
commit9c974ebc46046b2fcaddf51e924c8b23ed20367a (patch)
tree51a24b868bc00a3b21316bbc109ff73c66ac6c9c /pose-widget
parent3dadc95e5b7b9ab0f50e4c977f63167cf30da852 (diff)
pose-widget: make octopus less wide
Now it looks less like a frog.
Diffstat (limited to 'pose-widget')
-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);