From 3ba0ef71928542daab07b40e7c60840fc9a56f88 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 25 Sep 2013 10:36:21 -0400 Subject: fix a typo in canvas-debug.h --- libs/canvas/canvas/debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/canvas/canvas/debug.h b/libs/canvas/canvas/debug.h index e6636e9cb3..a025e605dc 100644 --- a/libs/canvas/canvas/debug.h +++ b/libs/canvas/canvas/debug.h @@ -36,7 +36,7 @@ namespace PBD { #ifdef CANVAS_DEBUG #define CANVAS_DEBUG_NAME(i, n) i->name = n; #else -#define CANVAS_DEBUG(i, n) /* empty */ +#define CANVAS_DEBUG_NAME(i, n) /* empty */ #endif namespace ArdourCanvas { -- cgit v1.2.3 From 67bb9a732aaa4a01bb706bca743c3673314b44b2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 25 Sep 2013 10:36:42 -0400 Subject: add casting for MSVC sqrt --- libs/canvas/lookup_table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/canvas/lookup_table.cc b/libs/canvas/lookup_table.cc index be0e553ee7..9697ba8103 100644 --- a/libs/canvas/lookup_table.cc +++ b/libs/canvas/lookup_table.cc @@ -79,7 +79,7 @@ OptimizingLookupTable::OptimizingLookupTable (Group const & group, int items_per /* number of cells */ int const cells = items.size() / _items_per_cell; /* hence number down each side of the table's square */ - _dimension = max (1, int (rint (sqrt (cells)))); + _dimension = max (1, int (rint (sqrt ((double)cells)))); _cells = new Cell*[_dimension]; for (int i = 0; i < _dimension; ++i) { -- cgit v1.2.3 From 18850253e9f0034fad132e0da07a2651ce041450 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 25 Sep 2013 10:38:04 -0400 Subject: only generate some current canvas debug output when CANVAS_DEBUG is defined, to quieten things down --- libs/canvas/canvas.cc | 6 ++++-- libs/canvas/group.cc | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/canvas/canvas.cc b/libs/canvas/canvas.cc index b62393b334..908af16065 100644 --- a/libs/canvas/canvas.cc +++ b/libs/canvas/canvas.cc @@ -342,17 +342,19 @@ GtkCanvas::enter_leave_items (Duple const & point, int state) */ cerr << "E/L: " << items.size() << " to check at " << point << endl; +#ifdef CANVAS_DEBUG for (vector::const_reverse_iterator i = items.rbegin(); i != items.rend(); ++i) { cerr << '\t' << (*i)->whatami() << ' ' << (*i)->name << " ignore ? " << (*i)->ignore_events() << " current ? " << (_current_item == (*i)) << endl; } +#endif cerr << "------------\n"; for (vector::const_reverse_iterator i = items.rbegin(); i != items.rend(); ++i) { Item const * new_item = *i; - +#ifdef CANVAS_DEBUG cerr << "\tE/L check out " << new_item->whatami() << ' ' << new_item->name << " ignore ? " << new_item->ignore_events() << " current ? " << (_current_item == new_item) << endl; - +#endif if (new_item->ignore_events()) { cerr << "continue1\n"; continue; diff --git a/libs/canvas/group.cc b/libs/canvas/group.cc index 9a846dfcf2..63754ae72f 100644 --- a/libs/canvas/group.cc +++ b/libs/canvas/group.cc @@ -295,6 +295,7 @@ Group::add_items_at_point (Duple const point, vector& items) const void Group::dump (ostream& o) const { +#ifdef CANVAS_DEBUG o << _canvas->indent(); o << "Group " << this << " [" << name << ']'; o << " @ " << position(); @@ -311,6 +312,7 @@ Group::dump (ostream& o) const } o << endl; +#endif ArdourCanvas::dump_depth++; -- cgit v1.2.3