summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_summary.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-09-02 01:44:27 +0000
committerCarl Hetherington <carl@carlh.net>2010-09-02 01:44:27 +0000
commit6f61058723b2ebc77da88bb964296f6576563868 (patch)
treec3dc018dd92d86e905f89b84c872a0c73d79912d /gtk2_ardour/editor_summary.cc
parentb9191eb0c564369bae6dbe4d0b1cd3bf2e64a74e (diff)
Make it easier to move the summary rectangle around when it is narrow or low in height.
git-svn-id: svn://localhost/ardour2/branches/3.0@7730 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_summary.cc')
-rw-r--r--gtk2_ardour/editor_summary.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc
index c87d914317..69dd3772cb 100644
--- a/gtk2_ardour/editor_summary.cc
+++ b/gtk2_ardour/editor_summary.cc
@@ -363,12 +363,19 @@ EditorSummary::get_position (double x, double y) const
{
/* how close the mouse has to be to the edge of the view rectangle to be considered `on it',
in pixels */
- int const edge_size = 8;
+
+ int x_edge_size = (_view_rectangle_x.second - _view_rectangle_x.first) / 4;
+ x_edge_size = min (x_edge_size, 8);
+ x_edge_size = max (x_edge_size, 1);
+
+ int y_edge_size = (_view_rectangle_y.second - _view_rectangle_y.first) / 4;
+ y_edge_size = min (y_edge_size, 8);
+ y_edge_size = max (y_edge_size, 1);
- bool const near_left = (std::abs (x - _view_rectangle_x.first) < edge_size);
- bool const near_right = (std::abs (x - _view_rectangle_x.second) < edge_size);
- bool const near_top = (std::abs (y - _view_rectangle_y.first) < edge_size);
- bool const near_bottom = (std::abs (y - _view_rectangle_y.second) < edge_size);
+ bool const near_left = (std::abs (x - _view_rectangle_x.first) < x_edge_size);
+ bool const near_right = (std::abs (x - _view_rectangle_x.second) < x_edge_size);
+ bool const near_top = (std::abs (y - _view_rectangle_y.first) < y_edge_size);
+ bool const near_bottom = (std::abs (y - _view_rectangle_y.second) < y_edge_size);
bool const within_x = _view_rectangle_x.first < x && x < _view_rectangle_x.second;
bool const within_y = _view_rectangle_y.first < y && y < _view_rectangle_y.second;