mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-14 19:27:05 -04:00
ui: skip timeline ruler labels that would run under the marker bin
The comp-end label was clipped to a stray "1" against the marker bin. (cherry picked from commit f62afa0364f1bf38f0b0b5eda5ccc07f33174790) (cherry picked from commit 2e3d08dad7d73a14688bf6d8bfb1712ab51443a2) (cherry picked from commit 773471c3a39bef51f4763d21d007534cfd95c0b1) (cherry picked from commit 176508a82145eb7063c776f6cd44ba925a8edd99)
This commit is contained in:
1 parent
9af5560c1f
commit
5b2b99464d
1 file changed
+5
-1
@@ -1567,7 +1567,11 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
||||
pr.line_segment([pos2(x, ruler.max.y - 10.0), pos2(x, ruler.max.y)], Stroke::new(1.0, t.tl_ruler_tick));
|
||||
let fno = (s / fd).round() as i64;
|
||||
let label = ruler_label(fno, fps_i, &app.session.project.settings);
|
||||
pr.text(pos2(x + 3.0, ruler.max.y - 16.0), Align2::LEFT_CENTER, label, Tokens::ui(10.0), t.tl_ruler_text);
|
||||
// A label that would run under the marker bin is left out rather than cut to a stray digit.
|
||||
let g = pr.layout_no_wrap(label, Tokens::ui(10.0), t.tl_ruler_text);
|
||||
if x + 3.0 + g.size().x <= bin.min.x {
|
||||
pr.galley(pos2(x + 3.0, ruler.max.y - 16.0 - g.size().y / 2.0), g, t.tl_ruler_text);
|
||||
}
|
||||
for k in 1..5 {
|
||||
let xx = tm.x(s + secs_per_label * k as f64 / 5.0);
|
||||
pr.line_segment([pos2(xx, ruler.max.y - 4.0), pos2(xx, ruler.max.y)], Stroke::new(1.0, t.tl_ruler_tick.gamma_multiply(0.6)));
|
||||
|
||||
Reference in new issue
Block a user