Merge branch 'master' of git.ucc.asn.au:ipdf/code
authorDavid Gow <[email protected]>
Mon, 6 Oct 2014 08:25:17 +0000 (16:25 +0800)
committerDavid Gow <[email protected]>
Mon, 6 Oct 2014 08:25:17 +0000 (16:25 +0800)
1  2 
src/document.cpp
src/view.cpp

diff --combined src/document.cpp
@@@ -225,16 -225,16 +225,16 @@@ void Document::OverlayQuadChildren(Quad
        switch (type)
        {
                case QTC_TOP_LEFT:
 -                      orig_node = m_quadtree.nodes[orig_parent].top_left = new_index;
 +                      orig_node = m_quadtree.nodes[orig_parent].top_left;
                        break;
                case QTC_TOP_RIGHT:
 -                      orig_node = m_quadtree.nodes[orig_parent].top_right = new_index;
 +                      orig_node = m_quadtree.nodes[orig_parent].top_right;
                        break;
                case QTC_BOTTOM_LEFT:
 -                      orig_node = m_quadtree.nodes[orig_parent].bottom_left = new_index;
 +                      orig_node = m_quadtree.nodes[orig_parent].bottom_left;
                        break;
                case QTC_BOTTOM_RIGHT:
 -                      orig_node = m_quadtree.nodes[orig_parent].bottom_right = new_index;
 +                      orig_node = m_quadtree.nodes[orig_parent].bottom_right;
                        break;
                default:
                        Fatal("Tried to overlay a QuadTree child of invalid type!");
  
        // Add us to the node's overlay linked list.
        QuadTreeIndex prev_overlay = orig_node;
 -      while (m_quadtree.nodes[prev_overlay].next_overlay != -1);
 +      while (m_quadtree.nodes[prev_overlay].next_overlay != -1) prev_overlay = m_quadtree.nodes[prev_overlay].next_overlay;
 +      Debug("- Original node %d, Previous overlay %d, new overlay %d", orig_node, prev_overlay, new_index);
        m_quadtree.nodes[prev_overlay].next_overlay = new_index;
  
        // Recurse into any extant children.
                OverlayQuadChildren(orig_node, new_index, QTC_BOTTOM_RIGHT);
  
        m_quadtree.nodes[new_index].object_dirty = m_quadtree.nodes[new_index].object_end;
 +      m_quadtree.nodes[new_index].next_overlay = -1;
  }
  
  void Document::PropagateQuadChanges(QuadTreeIndex node)
@@@ -445,8 -443,11 +445,11 @@@ done: // matches is not amused, but sul
                m_count++;
                PropagateQuadChanges(qti);
        }
+       return m_count;
+ #else // words fail me (still not amused)
+       return (m_count++);
  #endif
-       return m_count; // Why can't we just use the size of types or something?
+       
  }
  
  unsigned Document::AddBezierData(const Bezier & bezier)
diff --combined src/view.cpp
@@@ -377,8 -377,7 +377,8 @@@ void View::Render(int width, int height
        glPopDebugGroup();
        
  #ifndef CONTROLPANEL_DISABLED
 -      ControlPanel::Update();
 +      // The powers that be suggest that this may be causing of the segfaults.
 +      //ControlPanel::Update();
  #endif //CONTROLPANEL_DISABLED
        //Debug("Completed Render");
        
@@@ -543,10 -542,10 +543,10 @@@ void View::UpdateObjBoundsVBO(unsigned 
                        obj_bounds = TransformToViewCoords(m_document.m_objects.bounds[id]);
                }
                GPUObjBounds gpu_bounds = {
-                       (float)Float(obj_bounds.x),
-                       (float)Float(obj_bounds.y),
-                       (float)Float(obj_bounds.x + obj_bounds.w),
-                       (float)Float(obj_bounds.y + obj_bounds.h)
+                       Float(obj_bounds.x),
+                       Float(obj_bounds.y),
+                       Float(obj_bounds.x + obj_bounds.w),
+                       Float(obj_bounds.y + obj_bounds.h)
                };
  
                obj_bounds_builder.Add(gpu_bounds);
                        if (!m_use_gpu_transform)
                                obj_bounds = TransformToViewCoords(obj_bounds);
                        GPUObjBounds gpu_bounds = {
-                               Float(obj_bounds.x),
-                               Float(obj_bounds.y),
-                               Float(obj_bounds.x + obj_bounds.w),
-                               Float(obj_bounds.y + obj_bounds.h)
+                               ClampFloat(obj_bounds.x),
+                               ClampFloat(obj_bounds.y),
+                               ClampFloat(obj_bounds.x + obj_bounds.w),
+                               ClampFloat(obj_bounds.y + obj_bounds.h)
                        };
                        obj_bounds_builder.Add(gpu_bounds);
                        //Debug("Path %d %s -> %s via %s", id, m_document.m_objects.bounds[id].Str().c_str(), obj_bounds.Str().c_str(), pbounds.Str().c_str()); 
                }
                GPUObjBounds p_gpu_bounds = {
-                               Float(pbounds.x),
-                               Float(pbounds.y),
-                               Float(pbounds.x + pbounds.w),
-                               Float(pbounds.y + pbounds.h)
+                               ClampFloat(pbounds.x),
+                               ClampFloat(pbounds.y),
+                               ClampFloat(pbounds.x + pbounds.w),
+                               ClampFloat(pbounds.y + pbounds.h)
                };              
                obj_bounds_builder.Add(p_gpu_bounds);
        }

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