Because merging is going to be fun.
[ipdf/code.git] / src / view.cpp
index 60f2976..554fb03 100644 (file)
@@ -173,7 +173,7 @@ void View::Render(int width, int height)
 #ifndef QUADTREE_DISABLED
        if (m_bounds_dirty)
        {
-               if (false && (m_bounds.x > 1.0 || m_bounds.x < 0.0 || m_bounds.y > 1.0 || m_bounds.y < 0.0 || m_bounds.w > 1.0 || m_bounds.h > 1.0))
+               if ( (m_bounds.x > 1.0 || m_bounds.x < 0.0 || m_bounds.y > 1.0 || m_bounds.y < 0.0 || m_bounds.w > 1.0 || m_bounds.h > 1.0))
                {
                        //TODO: Generate a new parent node.
                        if (m_document.GetQuadTree().nodes[m_current_quadtree_node].parent != QUADTREE_EMPTY)
@@ -229,6 +229,15 @@ void View::Render(int width, int height)
        }
        m_screen.DebugFontPrintF("Current View QuadTree Node: %d (objs: %d -> %d)\n", m_current_quadtree_node, m_document.GetQuadTree().nodes[m_current_quadtree_node].object_begin,
                                m_document.GetQuadTree().nodes[m_current_quadtree_node].object_end);
+
+       Rect view_top_bounds = m_bounds;
+       QuadTreeIndex tmp = m_current_quadtree_node;
+       while (tmp != -1)
+       {
+               view_top_bounds = TransformFromQuadChild(view_top_bounds, m_document.GetQuadTree().nodes[tmp].child_type);
+               tmp = m_document.GetQuadTree().nodes[tmp].parent;
+       }
+       m_screen.DebugFontPrintF("Equivalent View Bounds: %s\n", view_top_bounds.Str().c_str());
 #endif
 
        if (!m_use_gpu_rendering)

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