Go nuts with Qt
[ipdf/code.git] / src / view.cpp
index e0efce9..d7d1e34 100644 (file)
@@ -3,6 +3,10 @@
 #include "screen.h"
 #include "gl_core44.h"
 
+#ifndef CONTROLPANEL_DISABLED
+       #include "controlpanel.h"
+#endif //CONTROLPANEL_DISABLED
+
 using namespace IPDF;
 using namespace std;
 
@@ -73,6 +77,21 @@ void View::Translate(Real x, Real y)
        m_bounds_dirty = true;
 }
 
+/**
+ * Set View bounds
+ * @param bounds - New bounds
+ */
+void View::SetBounds(const Rect & bounds)
+{
+       m_bounds.x = bounds.x;
+       m_bounds.y = bounds.y;
+       m_bounds.w = bounds.w;
+       m_bounds.h = bounds.h;
+       if (!m_use_gpu_transform)
+               m_buffer_dirty = true;
+       m_bounds_dirty = true;
+}
+
 /**
  * Scale the View at a point
  * @param x, y - Coordinates to scale at (eg: Mouse cursor position)
@@ -239,6 +258,11 @@ void View::Render(int width, int height)
        m_cached_display.Blit(); // blit FrameBuffer to screen
        m_buffer_dirty = false;
        glPopDebugGroup();
+       
+#ifndef CONTROLPANEL_DISABLED
+       ControlPanel::Update();
+#endif //CONTROLPANEL_DISABLED
+       
 }
 
 #ifndef QUADTREE_DISABLED

UCC git Repository :: git.ucc.asn.au