summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-01-29 22:57:19 +0000
committerCarl Hetherington <cth@carlh.net>2016-01-29 22:57:19 +0000
commit218ffe2c5f92ed19ec488cda5012b64fcabd5e3f (patch)
treea0604653c3f2d68f55a8a457e6be896a3e75f856 /src
parent13aceac46acc966ffddcbc08982e8090415625f3 (diff)
Fix indistinct selection of small objects on the timeline.
Diffstat (limited to 'src')
-rw-r--r--src/lib/rect.h9
-rw-r--r--src/wx/timeline_content_view.cc8
-rw-r--r--src/wx/timeline_view.cc4
3 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/rect.h b/src/lib/rect.h
index 97b90abc5..5758dd04e 100644
--- a/src/lib/rect.h
+++ b/src/lib/rect.h
@@ -87,6 +87,15 @@ public:
height = std::max (y + height, other.y + other.height) - y;
}
+ Rect<T> extended (T amount) const {
+ Rect<T> c = *this;
+ c.x -= amount;
+ c.y -= amount;
+ c.width += amount * 2;
+ c.height += amount * 2;
+ return c;
+ }
+
bool contains (Position<T> p) const
{
return (p.x >= x && p.x <= (x + width) && p.y >= y && p.y <= (y + height));
diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc
index 858214c33..98ef0abb4 100644
--- a/src/wx/timeline_content_view.cc
+++ b/src/wx/timeline_content_view.cc
@@ -45,10 +45,10 @@ TimelineContentView::bbox () const
}
return dcpomatic::Rect<int> (
- time_x (content->position ()) - 8,
- y_pos (_track.get()) - 8,
- content->length_after_trim().seconds() * _timeline.pixels_per_second().get_value_or(0) + 16,
- _timeline.track_height() + 16
+ time_x (content->position ()),
+ y_pos (_track.get()),
+ content->length_after_trim().seconds() * _timeline.pixels_per_second().get_value_or(0),
+ _timeline.track_height()
);
}
diff --git a/src/wx/timeline_view.cc b/src/wx/timeline_view.cc
index a1c5fb7ec..fee1921ed 100644
--- a/src/wx/timeline_view.cc
+++ b/src/wx/timeline_view.cc
@@ -39,8 +39,8 @@ TimelineView::paint (wxGraphicsContext* g)
void
TimelineView::force_redraw ()
{
- _timeline.force_redraw (_last_paint_bbox);
- _timeline.force_redraw (bbox ());
+ _timeline.force_redraw (_last_paint_bbox.extended (4));
+ _timeline.force_redraw (bbox().extended (4));
}
int