From 9f33eb49ccb7fa8fb80f00865819beb499e70025 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 29 Dec 2018 14:32:13 +0100 Subject: Zoom canvas using scroll-wheel. --- src/outputwindow.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/outputwindow.h') diff --git a/src/outputwindow.h b/src/outputwindow.h index 5e91f71..fc63a44 100644 --- a/src/outputwindow.h +++ b/src/outputwindow.h @@ -47,7 +47,10 @@ public: void stopScript(); void setSpeed(int s); + void setScale(double s); + double getScale() const; + void setColour(int r, int g, int b, int a); void loadPen(QString file); @@ -60,7 +63,8 @@ public slots: void reset(); protected: - void paintEvent(QPaintEvent * event); + void wheelEvent(QWheelEvent* event); + void paintEvent(QPaintEvent* event); private: class ColLine @@ -83,5 +87,5 @@ private: volatile bool loadpen; QString penfile; - volatile float scale; + volatile float scale{2.0f}; }; -- cgit v1.2.3