projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Plug a memory leak (recent session list, session info)
[ardour.git]
/
libs
/
canvas
/
poly_item.cc
diff --git
a/libs/canvas/poly_item.cc
b/libs/canvas/poly_item.cc
index 0d3369f70b0a822ba94eaa359027aa75b6c7dd65..fc60778960e56890a2c52011ceb5dfdf7bfeb295 100644
(file)
--- a/
libs/canvas/poly_item.cc
+++ b/
libs/canvas/poly_item.cc
@@
-27,22
+27,25
@@
using namespace std;
using namespace ArdourCanvas;
using namespace std;
using namespace ArdourCanvas;
-PolyItem::PolyItem (Group* parent)
- : Item (parent)
- , Outline (parent)
+PolyItem::PolyItem (Canvas* c)
+ : Item (c)
{
{
+}
+PolyItem::PolyItem (Item* parent)
+ : Item (parent)
+{
}
void
PolyItem::compute_bounding_box () const
{
}
void
PolyItem::compute_bounding_box () const
{
-
+
if (!_points.empty()) {
Rect bbox;
Points::const_iterator i = _points.begin();
if (!_points.empty()) {
Rect bbox;
Points::const_iterator i = _points.begin();
-
+
bbox.x0 = bbox.x1 = i->x;
bbox.y0 = bbox.y1 = i->y;
bbox.x0 = bbox.x1 = i->x;
bbox.y0 = bbox.y1 = i->y;
@@
-56,13
+59,13
@@
PolyItem::compute_bounding_box () const
++i;
}
++i;
}
- _bounding_box = bbox.expand (_outline_width);
+ _bounding_box = bbox.expand (_outline_width + 0.5);
+
-
} else {
} else {
- _bounding_box =
boost::optional<Rect>
();
+ _bounding_box =
Rect
();
}
}
-
+
_bounding_box_dirty = false;
}
_bounding_box_dirty = false;
}
@@
-110,14
+113,14
@@
PolyItem::render_curve (Rect const & area, Cairo::RefPtr<Cairo::Context> context
Duple c2 = item_to_window (Duple (cp2->x, cp2->y));
c = item_to_window (Duple (p->x, p->y));
Duple c2 = item_to_window (Duple (cp2->x, cp2->y));
c = item_to_window (Duple (p->x, p->y));
-
- context->curve_to (c1.x + pixel_adjust,
- c1.y + pixel_adjust,
- c2.x + pixel_adjust,
- c2.y + pixel_adjust,
- c.x + pixel_adjust,
+
+ context->curve_to (c1.x + pixel_adjust,
+ c1.y + pixel_adjust,
+ c2.x + pixel_adjust,
+ c2.y + pixel_adjust,
+ c.x + pixel_adjust,
c.y + pixel_adjust);
c.y + pixel_adjust);
-
+
++cp1;
++cp2;
++p;
++cp1;
++cp2;
++p;
@@
-130,9
+133,9
@@
PolyItem::set (Points const & points)
if (_points != points) {
begin_change ();
if (_points != points) {
begin_change ();
-
+
_points = points;
_points = points;
-
+
_bounding_box_dirty = true;
end_change ();
}
_bounding_box_dirty = true;
end_change ();
}