X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fview.cpp;h=d7d1e34c30b245fa823b63146e58033d66914a2a;hp=8b1857df7dc8070edd0c3a64be1dff68cf8bffbc;hb=c2885c9d467ec359bccd7bbe7369ff4c02439414;hpb=5f25f354c33142215147b1fa3d18445bd0d7a6ee diff --git a/src/view.cpp b/src/view.cpp index 8b1857d..d7d1e34 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -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; @@ -28,6 +32,7 @@ View::View(Document & document, Screen & screen, const Rect & bounds, const Colo m_object_renderers[RECT_OUTLINE] = new RectOutlineRenderer(); m_object_renderers[CIRCLE_FILLED] = new CircleFilledRenderer(); m_object_renderers[BEZIER] = new BezierRenderer(); + m_object_renderers[GROUP] = new GroupRenderer(); // To add rendering for a new type of object; // 1. Add enum to ObjectType in ipdf.h @@ -72,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) @@ -238,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