projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cut ops can start with the mouse pointer not over a region
[ardour.git]
/
libs
/
canvas
/
polygon.cc
diff --git
a/libs/canvas/polygon.cc
b/libs/canvas/polygon.cc
index 2e818236160d77335aec155aae1245d3de4a2a6c..aa16a6017844c2cc6f3ba816eabac5b8ecd5f08d 100644
(file)
--- a/
libs/canvas/polygon.cc
+++ b/
libs/canvas/polygon.cc
@@
-21,15
+21,20
@@
using namespace ArdourCanvas;
using namespace ArdourCanvas;
-Polygon::Polygon (Group* parent)
- : Item (parent)
- , PolyItem (parent)
- , Fill (parent)
+Polygon::Polygon (Canvas* c)
+ : PolyItem (c)
, multiple (0)
, constant (0)
, cached_size (0)
{
, multiple (0)
, constant (0)
, cached_size (0)
{
+}
+Polygon::Polygon (Item* parent)
+ : PolyItem (parent)
+ , multiple (0)
+ , constant (0)
+ , cached_size (0)
+{
}
Polygon::~Polygon ()
}
Polygon::~Polygon ()
@@
-41,8
+46,7
@@
Polygon::~Polygon ()
void
Polygon::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
{
void
Polygon::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
{
- if (_outline) {
- setup_outline_context (context);
+ if (_outline || _fill) {
render_path (area, context);
if (!_points.empty ()) {
render_path (area, context);
if (!_points.empty ()) {
@@
-51,7
+55,15
@@
Polygon::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
context->move_to (p.x, p.y);
}
context->move_to (p.x, p.y);
}
- context->stroke_preserve ();
+ }
+
+ if (_outline) {
+ setup_outline_context (context);
+ if (_fill) {
+ context->stroke_preserve ();
+ } else {
+ context->stroke ();
+ }
}
if (_fill) {
}
if (_fill) {
@@
-96,7
+108,7
@@
Polygon::cache_shape_computation () const
bool
Polygon::covers (Duple const & point) const
{
bool
Polygon::covers (Duple const & point) const
{
- Duple p =
canvas
_to_item (point);
+ Duple p =
window
_to_item (point);
Points::size_type npoints = _points.size();
Points::size_type npoints = _points.size();