diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-12-02 11:35:11 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-12-02 11:35:11 +0000 |
| commit | 9b1aef54c2ad164337a82ac6913ba5a095bf5266 (patch) | |
| tree | e27eb2254320610df4e42421e36675667a86d1af /src | |
| parent | 148952ec8b13eb382a4d60bc34a7329203f0df95 (diff) | |
Don't show reel labels if there is no space.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/timeline_reels_view.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wx/timeline_reels_view.cc b/src/wx/timeline_reels_view.cc index 6013c60a7..cc9d401cf 100644 --- a/src/wx/timeline_reels_view.cc +++ b/src/wx/timeline_reels_view.cc @@ -86,7 +86,10 @@ TimelineReelsView::do_paint (wxGraphicsContext* gc) wxDouble str_leading; gc->GetTextExtent (str, &str_width, &str_height, &str_descent, &str_leading); - int const tx = time_x (DCPTime((i.from.get() + i.to.get()) / 2)); - gc->DrawText (str, tx - str_width / 2, _y + 4); + int const available_width = time_x (DCPTime (i.to.get() - i.from.get())); + + if (available_width > str_width) { + gc->DrawText (str, time_x (DCPTime (i.from.get())) + (available_width - str_width) / 2, _y + 4); + } } } |
