+ QuadTreeIndex overlay = node;
+ while(overlay != -1)
+ {
+ //Debug("Rendering QT node %d, (overlay %d, objs: %d -- %d)\n", node, overlay, m_document.GetQuadTree().nodes[overlay].object_begin, m_document.GetQuadTree().nodes[overlay].object_end);
+ if (m_document.GetQuadTree().nodes[overlay].render_dirty)
+ m_buffer_dirty = m_render_dirty = true;
+ RenderRange(width, height, m_document.GetQuadTree().nodes[overlay].object_begin, m_document.GetQuadTree().nodes[overlay].object_end);
+ const_cast<bool&>(m_document.GetQuadTree().nodes[overlay].render_dirty) = false;
+ overlay = m_document.GetQuadTree().nodes[overlay].next_overlay;
+ }
+
+ if (m_bounds.Intersects(Rect(1,1,1,1)))
+ {
+ m_bounds = Rect(m_bounds.x - 1, m_bounds.y - 1, m_bounds.w, m_bounds.h);
+ m_bounds_dirty = true;
+ RenderQuadtreeNode(width, height, m_document.GetQuadTree().GetNeighbour(node, 1, 1, &m_document), remaining_depth - 1);
+ }
+ m_bounds = old_bounds;
+ if (m_bounds.Intersects(Rect(1,0,1,1)))
+ {
+ m_bounds = Rect(m_bounds.x - 1, m_bounds.y, m_bounds.w, m_bounds.h);
+ m_bounds_dirty = true;
+ RenderQuadtreeNode(width, height, m_document.GetQuadTree().GetNeighbour(node, 1, 0, &m_document), remaining_depth - 1);
+ }
+ m_bounds = old_bounds;
+ if (m_bounds.Intersects(Rect(0,1,1,1)))
+ {
+ m_bounds = Rect(m_bounds.x, m_bounds.y - 1, m_bounds.w, m_bounds.h);
+ m_bounds_dirty = true;
+ RenderQuadtreeNode(width, height, m_document.GetQuadTree().GetNeighbour(node, 0, 1, &m_document), remaining_depth - 1);
+ }
+ m_bounds = old_bounds;
+ m_bounds_dirty = true;