mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
whoah cursor is back
This commit is contained in:
parent
377a637eec
commit
ab2b7199a8
1 changed files with 19 additions and 16 deletions
|
|
@ -38,29 +38,23 @@ impl PianoHorizontal {
|
|||
}
|
||||
|
||||
render!(|self: PianoHorizontal|{
|
||||
let bg = TuiTheme::g(32);
|
||||
let color = self.color;
|
||||
let note_lo = self.range.note_lo();
|
||||
let note_hi = self.range.note_hi();
|
||||
let time_lock = self.range.time_lock();
|
||||
let time_start = self.range.time_start();
|
||||
let time_zoom = self.range.time_zoom();
|
||||
let time_point = self.point.time_point();
|
||||
let note_point = self.point.note_point();
|
||||
let note_len = self.point.note_len();
|
||||
let range = &self.range;
|
||||
let point = &self.point;
|
||||
let buffer = &self.buffer;
|
||||
let color = self.color;
|
||||
let range = &self.range;
|
||||
let point = &self.point;
|
||||
let buffer = &self.buffer;
|
||||
let keys = move||PianoHorizontalKeys { range, point, color }; //note_lo, note_hi, note_point: Some(note_point), };
|
||||
let timeline = move||PianoHorizontalTimeline { range, color };
|
||||
let notes = move||PianoHorizontalNotes { range, buffer };
|
||||
let cursor = move||PianoHorizontalCursor { range, point };
|
||||
let keys_width = 5;
|
||||
Tui::fill_xy(Tui::bg(bg, Bsp::s(
|
||||
Tui::fill_xy(Tui::bg(color.dark.rgb, Bsp::s(
|
||||
Tui::fill_x(Tui::push_x(keys_width, timeline())),
|
||||
Bsp::w(
|
||||
Tui::shrink_x(keys_width, Tui::fill_xy(
|
||||
lay!([&self.size, Tui::debug(Tui::fill_xy(lay!([notes(), cursor()])))])
|
||||
lay!([&self.size, Tui::fill_xy(lay!([
|
||||
Tui::fill_xy(notes()),
|
||||
Tui::fill_xy(cursor()),
|
||||
]))])
|
||||
)),
|
||||
Tui::fixed_x(keys_width, keys())
|
||||
),
|
||||
|
|
@ -117,7 +111,7 @@ render!(|self: PianoHorizontalKeys<'a>|render(|to|Ok({
|
|||
};
|
||||
}
|
||||
|
||||
let debug = true;
|
||||
let debug = false;
|
||||
if debug {
|
||||
to.blit(&format!("XYU"), x, y0, None);
|
||||
to.blit(&format!("x={x}"), x, y0+1, None);
|
||||
|
|
@ -169,6 +163,15 @@ render!(|self: PianoHorizontalNotes<'a>|render(|to|Ok({
|
|||
let time_start = self.range.time_start();
|
||||
let source = &self.buffer;
|
||||
let [x0, y0, w, h] = to.area().xywh();
|
||||
let debug = false;
|
||||
if debug {
|
||||
to.blit(&format!("KYP"), x0, y0, None);
|
||||
to.blit(&format!("x0={x0}"), x0, y0+1, None);
|
||||
to.blit(&format!("y0={y0}"), x0, y0+2, None);
|
||||
to.blit(&format!("note_lo={note_hi}"), x0, y0+3, None);
|
||||
to.blit(&format!("time_start={time_start}"), x0, y0+4, None);
|
||||
}
|
||||
return Ok(());
|
||||
for (x, target_x) in (x0..x0+w).enumerate() {
|
||||
for (y, target_y) in (y0..y0+h).enumerate() {
|
||||
if y > note_hi {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue