diff options
author | David Shah <davey1576@gmail.com> | 2018-07-12 19:39:08 +0000 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-07-12 19:39:08 +0000 |
commit | c732930272e38781c18b8591d85cd60fc1c60484 (patch) | |
tree | 8c695352188dfa696ec9878816f06866f060ede2 /gui/fpgaviewwidget.h | |
parent | f9ef4cd4bdeaccef6fd1522441be8fd0f80249c1 (diff) | |
parent | 681d82413191e5379bd5d0147d05a0879e005c49 (diff) | |
download | nextpnr-c732930272e38781c18b8591d85cd60fc1c60484.tar.gz nextpnr-c732930272e38781c18b8591d85cd60fc1c60484.tar.bz2 nextpnr-c732930272e38781c18b8591d85cd60fc1c60484.zip |
Merge branch 'q3k/fix-zoom' into 'master'
Fix Zooming
See merge request SymbioticEDA/nextpnr!8
Diffstat (limited to 'gui/fpgaviewwidget.h')
-rw-r--r-- | gui/fpgaviewwidget.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h index 8114a686..526c6199 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -252,13 +252,18 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions private: QPoint lastPos_; - float moveX_; - float moveY_; - float zoom_; LineShader lineShader_; + QMatrix4x4 viewMove_; + float zoom_; + QMatrix4x4 getProjection(void); + QVector4D mouseToWorldCoordinates(int x, int y); + + const float zoomNear_ = 1.0f; // do not zoom closer than this + const float zoomFar_ = 10000.0f; // do not zoom further than this + + const float zoomLvl1_ = 100.0f; + const float zoomLvl2_ = 50.0f; - float startDragX_; - float startDragY_; Context *ctx_; QColor backgroundColor; QColor gridColor; |