Skip to content

Commit

Permalink
fix offset parameter display
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviergodart committed Aug 9, 2024
1 parent 6243b4c commit 8b9e4da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions sequencer/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,6 @@ func (s step) ProbabilityString() string {

// OffsetString returns the string representation of the step offset.
func (s step) OffsetString() string {
if s.offset == 0 {
return ""
}
return fmt.Sprintf("+%d", s.offset)
}

Expand Down
6 changes: 5 additions & 1 deletion ui/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func (m mainModel) renderStepContent(step sequencer.Step) string {
if !step.IsActive() {
return strconv.Itoa(step.Position() + 1)
}
offset := step.OffsetString()
if step.Offset() == 0 {
offset = ""
}
return lipgloss.JoinVertical(
lipgloss.Left,
fmt.Sprintf("%d", step.Position()+1),
Expand All @@ -120,7 +124,7 @@ func (m mainModel) renderStepContent(step sequencer.Step) string {
Render(step.ProbabilityString()),
lipgloss.NewStyle().
MarginLeft(1).
Render(step.OffsetString()),
Render(offset),
),
)
}
Expand Down

0 comments on commit 8b9e4da

Please sign in to comment.