diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-09-08 21:29:55 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-09-08 21:29:55 +0200 |
commit | a258434aa3da53e46dc231c13e543318aa169141 (patch) | |
tree | ca8f49eacb515f8e3298750e315488b67bf353eb | |
parent | 945273ac61a699f2c05343f32259c514d359fb65 (diff) |
pose-widget: fix race on startup
-rw-r--r-- | pose-widget/pose-widget.cpp | 6 | ||||
-rw-r--r-- | pose-widget/pose-widget.hpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp index 6adf71d4..c6cda293 100644 --- a/pose-widget/pose-widget.cpp +++ b/pose-widget/pose-widget.cpp @@ -32,8 +32,6 @@ pose_transform::pose_transform(QWidget* dst) : image.fill(Qt::transparent); image2.fill(Qt::transparent); - - start(); } pose_transform::~pose_transform() @@ -50,6 +48,9 @@ void pose_widget::paintEvent(QPaintEvent* event) { p.drawImage(event->rect(), image, QRect(0, 0, pose_transform::w, pose_transform::h)); }); + + if (!xform.isRunning()) + xform.start(); } void pose_transform::run() @@ -242,7 +243,6 @@ void pose_transform::project_quad_texture() const int dest_depth = image.depth() / 8; static constexpr int const_depth = 4; - if (unlikely(orig_depth != const_depth || dest_depth != const_depth)) { qDebug() << "pose-widget: octopus must be saved as .png with 32 bits pixel"; diff --git a/pose-widget/pose-widget.hpp b/pose-widget/pose-widget.hpp index 7bc66cd2..ba94e233 100644 --- a/pose-widget/pose-widget.hpp +++ b/pose-widget/pose-widget.hpp @@ -46,7 +46,7 @@ public: bool barycentric_coords(const vec2& px, vec2& uv, int& i) const; }; -struct pose_transform final : private QThread +struct pose_transform final : QThread { pose_transform(QWidget* dst); ~pose_transform(); |