diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-10-05 22:49:02 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-10-05 22:50:34 +0200 |
commit | 96cd6bc12cd606154ce69889b94043c0a658fdc3 (patch) | |
tree | ab797466f1a0ca07afd88450e89eb2d5c3ec27c0 /pose-widget | |
parent | 48632ae113bc4a6e47756327699fa3f626b4afe9 (diff) |
api, cv, gui, pose-widget: remove window visibility check
Causes freezes on multiple displays.
Reported and tested in realtime by: @kzfr
Diffstat (limited to 'pose-widget')
-rw-r--r-- | pose-widget/glwidget.cpp | 19 | ||||
-rw-r--r-- | pose-widget/glwidget.h | 6 |
2 files changed, 4 insertions, 21 deletions
diff --git a/pose-widget/glwidget.cpp b/pose-widget/glwidget.cpp index 0aa06350..8e7784ed 100644 --- a/pose-widget/glwidget.cpp +++ b/pose-widget/glwidget.cpp @@ -6,7 +6,6 @@ */ #include "glwidget.h" -#include "api/is-window-visible.hpp" #include "compat/util.hpp" #include <cmath> #include <algorithm> @@ -15,20 +14,20 @@ #include <QDebug> -GLWidget::GLWidget(QWidget *parent) : QWidget(parent), visible(true) +GLWidget::GLWidget(QWidget *parent) : QWidget(parent) { Q_INIT_RESOURCE(posewidget); front = QImage(QString(":/images/side1.png")); back = QImage(QString(":/images/side6.png")); - rotateBy_real(0, 0, 0, 0, 0, 0); + rotateBy(0, 0, 0, 0, 0, 0); } GLWidget::~GLWidget() { } -void GLWidget::paintEvent (QPaintEvent * event) +void GLWidget::paintEvent(QPaintEvent * event) { QPainter p(this); project_quad_texture(); @@ -37,18 +36,6 @@ void GLWidget::paintEvent (QPaintEvent * event) void GLWidget::rotateBy(double xAngle, double yAngle, double zAngle, double x, double y, double z) { - if (visible_timer.elapsed_ms() > 250) - { - visible = is_window_visible(this); - visible_timer.start(); - } - - if (visible) - rotateBy_real(xAngle, yAngle, zAngle, x, y, z); -} - -void GLWidget::rotateBy_real(double xAngle, double yAngle, double zAngle, double x, double y, double z) -{ using std::sin; using std::cos; diff --git a/pose-widget/glwidget.h b/pose-widget/glwidget.h index 7965130c..072ea644 100644 --- a/pose-widget/glwidget.h +++ b/pose-widget/glwidget.h @@ -12,7 +12,6 @@ #include <QPixmap> #include "api/plugin-api.hpp" #include "logic/simple-mat.hpp" -#include "compat/timer.hpp" #ifdef BUILD_pose_widget # define POSE_WIDGET_EXPORT Q_DECL_EXPORT @@ -31,9 +30,8 @@ public: GLWidget(QWidget *parent); ~GLWidget(); void rotateBy(double xAngle, double yAngle, double zAngle, double x, double y, double z); - void rotateBy_real(double xAngle, double yAngle, double zAngle, double x, double y, double z); protected: - void paintEvent (QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; private: vec2 project(const vec3& point); vec3 project2(const vec3& point); @@ -45,6 +43,4 @@ private: QImage front; QImage back; QImage image; - Timer visible_timer; - bool visible; }; |