clear waveform cache when shape changes - fixes #6525
[ardour.git] / libs / canvas / arrow.cc
index 92a795c9540c316d3153bf2d547a69252b7b412b..d78b04ef5804ceb867c48bfb380900c24d1a5da3 100644 (file)
@@ -63,6 +63,23 @@ Arrow::setup ()
        CANVAS_DEBUG_NAME (_line, "arrow line");
 }
 
+void
+Arrow::compute_bounding_box () const
+{
+       /* Compute our bounding box manually rather than using the default
+          container algorithm, since having the bounding box with origin other
+          than zero causes strange problems for mysterious reasons. */
+
+       const double outline_pad = 0.5 + (_line->outline_width() / 2.0);
+       const double head_width  = std::max(_heads[0].width, _heads[1].width);
+
+       _bounding_box = Rect(0,
+                            0,
+                            _line->x1() + (head_width / 2.0) + outline_pad,
+                            _line->y1());
+
+       _bounding_box_dirty = false;
+}
 
 /** Set whether to show an arrow head at one end or other
  *  of the line.