Painfully merge branch 'master' of git.ucc.asn.au:ipdf/code
authorDavid Gow <[email protected]>
Sun, 5 Oct 2014 04:33:48 +0000 (12:33 +0800)
committerDavid Gow <[email protected]>
Sun, 5 Oct 2014 04:33:48 +0000 (12:33 +0800)
Conflicts:
src/document.cpp

1  2 
src/document.cpp

@@@ -417,34 -340,24 +417,34 @@@ unsigned Document::Add(ObjectType type
  #ifndef QUADTREE_DISABLED
        if (qti != -1)
        {
 -              while (m_quadtree.nodes[qti].next_overlay != -1)
 +              QuadTreeIndex new_qti = qti;
 +              while (m_quadtree.nodes[new_qti].next_overlay != -1)
                {
 -                      if (m_count == m_quadtree.nodes[qti].object_end+1)
 +                      if (m_count == m_quadtree.nodes[new_qti].object_end+1)
                        {
 -                              m_quadtree.nodes[qti].object_end++;
 +                              m_quadtree.nodes[new_qti].object_end++;
                                goto done;
                        }
 -                      qti = m_quadtree.nodes[qti].next_overlay;
 +                      new_qti = m_quadtree.nodes[new_qti].next_overlay;
 +              }
 +              {
 +                      QuadTreeIndex overlay = m_quadtree.nodes.size();
 +                      Debug("Adding new overlay, nqti = %d, overlay = %d", new_qti, overlay);
 +                      m_quadtree.nodes.push_back(m_quadtree.nodes[qti]);
 +                      m_quadtree.nodes[overlay].object_begin = m_count;
 +                      // All objects are dirty.
 +                      m_quadtree.nodes[overlay].object_dirty = m_count;
 +                      m_quadtree.nodes[overlay].object_end = m_count+1;
 +                      m_quadtree.nodes[overlay].next_overlay = -1;
 +                      m_quadtree.nodes[new_qti].next_overlay = overlay;
 +                      new_qti = overlay;
                }
- done:
 -              QuadTreeIndex overlay = m_quadtree.nodes.size();
 -              m_quadtree.nodes.push_back(m_quadtree.nodes[qti]);
 -              m_quadtree.nodes[overlay].object_begin = m_count;
 -              m_quadtree.nodes[overlay].object_end = m_count+1;
 -              m_quadtree.nodes[qti].next_overlay = overlay;
++done: // matches is not amused, but sulix is nice and moved it inside the #ifdef for him.
 +              m_count++;
 +              PropagateQuadChanges(qti);
        }
 -done: // matches is not amused
  #endif
 -      return (m_count++); // Why can't we just use the size of types or something?
 +      return m_count; // Why can't we just use the size of types or something?
  }
  
  unsigned Document::AddBezierData(const Bezier & bezier)

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