From 96bb70f9efecc262827d00db2757efb4ed2ef3db Mon Sep 17 00:00:00 2001 From: Chris Bradbury Date: Sun, 11 Sep 2022 21:20:27 +0100 Subject: [PATCH] Invert comparison operators in `CellView.Size()` (#554) Fixes #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. --- views/cellarea.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/cellarea.go b/views/cellarea.go index 68ff9d6c..4d5594ba 100644 --- a/views/cellarea.go +++ b/views/cellarea.go @@ -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