1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:07:45 +00:00

Piano: Use a real transport in the TrackManager

This is technically only a stepping stone but needed to happen at some
point anyways. Now, there's no more integer time stored in Piano's
legacy datastructures directly.
This commit is contained in:
kleines Filmröllchen 2022-05-13 23:32:44 +02:00 committed by Linus Groh
parent 37b340a698
commit 7e04560af4
6 changed files with 29 additions and 28 deletions

View file

@ -160,7 +160,7 @@ void RollWidget::paint_event(GUI::PaintEvent& event)
painter.draw_text(note_name_rect, String::formatted("{}", note / notes_per_octave + 1), Gfx::TextAlignment::CenterLeft);
}
int x = m_roll_width * (static_cast<double>(m_track_manager.time()) / roll_length);
int x = m_roll_width * (static_cast<double>(m_track_manager.transport()->time()) / roll_length);
if (x > x_offset && x <= x_offset + widget_inner_rect().width())
painter.draw_line({ x, 0 }, { x, roll_height }, Gfx::Color::Black);