mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
fix misalignments in newly created clips
This commit is contained in:
parent
29f09a2556
commit
a16e5361d1
3 changed files with 6 additions and 6 deletions
|
|
@ -101,8 +101,8 @@ command!(|self: TekCommand, app: Tek|match self {
|
|||
if let Some(ref pool) = app.pool {
|
||||
if app.is_editing() {
|
||||
if let Selection::Clip(t, s) = app.selected {
|
||||
if let Some(scene) = app.scenes.get_mut(s.saturating_sub(1)) {
|
||||
if let Some(slot) = scene.clips.get_mut(t.saturating_sub(1)) {
|
||||
if let Some(scene) = app.scenes.get_mut(s) {
|
||||
if let Some(slot) = scene.clips.get_mut(t) {
|
||||
if slot.is_none() {
|
||||
let (index, mut clip) = pool.add_new_clip();
|
||||
// autocolor: new clip colors from scene and track color
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ impl Tek {
|
|||
} else {
|
||||
(None, Tui::g(96), ItemPalette::G[32])
|
||||
};
|
||||
let active = editing && same_track && selected_scene == Some(s+1);
|
||||
let active = editing && same_track && selected_scene == Some(s);
|
||||
let edit = |x|Bsp::b(x, When(active, &self.editor));
|
||||
let cell = self.view_scene_cell(same_track, s, &bg, prev, name, " ⏹ ", fg);
|
||||
map_south(offset, height, edit(Fixed::y(height, cell))) }
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@ impl Tek {
|
|||
fn tracks_sizes <'a> (&'a self, editing: bool, bigger: usize) -> impl TracksSizes<'a> {
|
||||
let mut x = 0;
|
||||
let active = match self.selected() {
|
||||
Selection::Track(t) if editing => Some(t.saturating_sub(1)),
|
||||
Selection::Clip(t, _) if editing => Some(t.saturating_sub(1)),
|
||||
Selection::Track(t) if editing => Some(t),
|
||||
Selection::Clip(t, _) if editing => Some(t),
|
||||
_ => None
|
||||
};
|
||||
self.tracks().iter().enumerate().map(move |(index, track)|{
|
||||
let width = if Some(index) == active { bigger } else { track.width.max(8) };
|
||||
let width = if Some(index) == active.copied() { bigger } else { track.width.max(8) };
|
||||
let data = (index, track, x, x + width);
|
||||
x += width + Self::TRACK_SPACING;
|
||||
data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue