diff options
author | Sergiusz Bazanski <q3k@q3k.org> | 2018-07-12 20:22:53 +0100 |
---|---|---|
committer | Sergiusz Bazanski <q3k@q3k.org> | 2018-07-12 20:22:53 +0100 |
commit | 284b4750ee6a3a5a4e33590cbbccaaccfd2c5899 (patch) | |
tree | 059ef47a84eba16a0e21d1ed8bb5824e126c5510 /gui/fpgaviewwidget.h | |
parent | 8a226626bec3acf09ec8d29aca1000e7efd645d0 (diff) | |
download | nextpnr-284b4750ee6a3a5a4e33590cbbccaaccfd2c5899.tar.gz nextpnr-284b4750ee6a3a5a4e33590cbbccaaccfd2c5899.tar.bz2 nextpnr-284b4750ee6a3a5a4e33590cbbccaaccfd2c5899.zip |
Fix zoom in fpgawidget
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 c281fd77..b49029dd 100644 --- a/gui/fpgaviewwidget.h +++ b/gui/fpgaviewwidget.h @@ -245,13 +245,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_; }; |