Skip to content

Commit

Permalink
Invert comparison operators in CellView.Size()
Browse files Browse the repository at this point in the history
Fixes gdamore#553

This function is supposed to return a minimum 2x2 square. However, as the comparison operators are the wrong way around a maximum 2x2 square is returned instead. Inverting the comparison operators fixes the issue.
  • Loading branch information
chrBrd committed Sep 8, 2022
1 parent a8322bf commit 90d9f44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions views/cellarea.go
Expand Up @@ -224,10 +224,10 @@ func (a *CellView) Size() (int, int) {
// We always return a minimum of two rows, and two columns.
w, h := a.model.GetBounds()
// Clip to a 2x2 minimum square; we can scroll within that.
if w > 2 {
if w < 2 {
w = 2
}
if h > 2 {
if h < 2 {
h = 2
}
return w, h
Expand Down

0 comments on commit 90d9f44

Please sign in to comment.