diff options
Diffstat (limited to 'src/Gui/RenderArea.h')
-rw-r--r-- | src/Gui/RenderArea.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Gui/RenderArea.h b/src/Gui/RenderArea.h index d0b4ad3..16c312e 100644 --- a/src/Gui/RenderArea.h +++ b/src/Gui/RenderArea.h @@ -2,6 +2,7 @@ #define ZOOMEDIT_GUI_RENDERAREA_H_ #include <gtkmm/drawingarea.h> +#include <gtkmm/scrollbar.h> #include <libglademm/xml.h> #include <gtk/gtkgl.h> @@ -15,7 +16,10 @@ class RenderArea : public Gtk::DrawingArea { private: static GdkGLConfig *glconfig; - float x, y; + Gtk::HScrollbar *hScrollbar; + Gtk::VScrollbar *vScrollbar; + + float xCenter, yCenter; int zoomLevel; float scale; @@ -28,9 +32,22 @@ class RenderArea : public Gtk::DrawingArea { void zoom(int zoom, float x = 0.5f, float y = 0.5f); void updateViewport(); + void updateScrollbars(float x = 0.5f, float y = 0.5f); + void updateScrolling(); void drawGrid(); + float getViewWidth() const { + return get_width()/scale; + } + + float getViewHeight() const { + return get_height()/scale; + } + + float getImageWidth() const {return 10;} + float getImageHeight() const {return 10;} + bool gdkGLBegin() { GtkWidget *widget = GTK_WIDGET(gobj()); |