viewer: implemented basic zoom

No scrolling functionality yet, but the zoom is functional and efficient.
This commit is contained in:
itsmattkc
2020-03-13 16:41:09 +11:00
parent 0418c8ab85
commit c1c8067ee7
5 changed files with 113 additions and 33 deletions
+21
View File
@@ -52,6 +52,16 @@ public:
*/
void SetChildSize(int width, int height);
/**
* @brief Set the zoom value of the child widget
*
* The number is an integer percentage (100 = 100%). Set to 0 to auto-fit.
*/
void SetZoom(int percent);
signals:
void RequestMatrix(const QMatrix4x4& matrix);
protected:
/**
* @brief Listen for resize events to ensure the child widget remains correctly sized
@@ -71,11 +81,22 @@ private:
*/
QWidget* widget_;
/**
* @brief Internal resolution values
*/
int width_;
int height_;
/**
* @brief Aspect ratio calculated from the size provided by SetChildSize()
*/
double aspect_ratio_;
/**
* @brief Internal zoom value
*/
int zoom_;
};
#endif // VIEWERSIZER_H