From 90d9f446453dfa95898ac9be3d6b445ba87a2d94 Mon Sep 17 00:00:00 2001 From: Chris Bradbury Date: Thu, 8 Sep 2022 06:17:23 +0100 Subject: [PATCH] Invert comparison operators in `CellView.Size()` 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