Skip to content

Commit

Permalink
combine conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
bcicen committed Feb 1, 2018
1 parent 10b9a6c commit 44a54e0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cwidgets/compact/grid.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ func NewCompactGrid() *CompactGrid {
func (cg *CompactGrid) Align() {
y := cg.Y

if cg.Offset >= len(cg.Rows) {
cg.Offset = 0
}
if cg.Offset < 0 {
if cg.Offset >= len(cg.Rows) || cg.Offset < 0 {
cg.Offset = 0
}

Expand Down

0 comments on commit 44a54e0

Please sign in to comment.