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.
This commit is contained in:
Chris Bradbury 2022-09-11 21:20:27 +01:00 committed by GitHub
parent eef35d4cfc
commit 96bb70f9ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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