diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-09-22 13:37:29 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-09-22 13:37:37 +0200 |
commit | e13c17f2436e12c3942c921e6764f6ade28887bf (patch) | |
tree | 4c133f6e40b9e7a8c69c3eda9f48188bb711d817 /pose-widget/pose-widget.cpp | |
parent | f6bec4948dda62c69ce7b242c96a0c7546a7f403 (diff) |
pose-widget: fix origin position
Diffstat (limited to 'pose-widget/pose-widget.cpp')
-rw-r--r-- | pose-widget/pose-widget.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp index 8b5b66f6..35b21bfc 100644 --- a/pose-widget/pose-widget.cpp +++ b/pose-widget/pose-widget.cpp @@ -44,11 +44,11 @@ void pose_widget::paintEvent(QPaintEvent*) t.translate(w*.5, h*.5); - constexpr double z_scale = 1./100; + constexpr double z_scale = 1./5; constexpr double xy_scale = .0075; double xy = std::sqrt(w*w + h*h) * xy_scale; - double s = clamp(.5 + -z * z_scale, .5, 2); + double s = clamp(.25 + -z * z_scale, .01, 2); t.scale(s, s); t.rotate(pitch, Qt::XAxis); @@ -57,11 +57,12 @@ void pose_widget::paintEvent(QPaintEvent*) t.translate(x * xy / s, y * xy / s); - t.translate(w*-.5, h*-.5); + t.translate(w*.5, h*-.5); QPainter p(this); p.setTransform(t); p.drawImage(rect(), img); } + } // ns pose_widget_impl |