Skip to content

Commit

Permalink
Always draw span borders, even if they occupy the entire span's width
Browse files Browse the repository at this point in the history
Not having borders around some spans looks inconsistent and like they're
not a proper part of the timeline. We'd rather cover up the handful of
colored pixels with borders than not have borders.

This also fixes a bug when a borderless span was left to a bordered
span, where the right span was missing its left border, thinking the
span to its left had a right border.
  • Loading branch information
dominikh committed Jan 9, 2024
1 parent 5a198bd commit 59b3f10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/gotraceui/timeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ func (track *Track) Layout(
highlightedSpans = append(highlightedSpans, clip.FRect{Min: minP, Max: maxP})
}

if dspSpans.Len() != 0 && dspSpans.AtPtr(0).State != statePlaceholder && endPx-startPx > float32(minSpanWidth) {
if dspSpans.Len() != 0 && dspSpans.AtPtr(0).State != statePlaceholder {
off := float32(spanBorderWidth)
leftOff := off
rightOff := -off
Expand Down

0 comments on commit 59b3f10

Please sign in to comment.