From 2f66ddcb912ebf031594427b149c5acb83fa7693 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 1 Oct 2021 13:34:58 +0200 Subject: Fixed resizing bugs in certain situations not covered by mycology --- pkg/field/set.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/field/set.go') diff --git a/pkg/field/set.go b/pkg/field/set.go index 5044898..c4cf2a4 100644 --- a/pkg/field/set.go +++ b/pkg/field/set.go @@ -25,8 +25,8 @@ func (f *Field) Set(x, y, v int) { } l.columns = append(l.columns, v) l.l = newL - if f.lx-f.x < l.l-l.x { - f.lx = l.l - l.x + if f.lx < l.l+l.x-f.x { + f.lx = l.l + l.x - f.x } } } else { @@ -60,8 +60,8 @@ func (f *Field) Set(x, y, v int) { f.lx = f.lx + f.x - x f.x = x } - if f.lx-f.x < x { - f.lx = x - f.x + if f.lx < x-f.x+1 { + f.lx = x - f.x + 1 } } } else { @@ -79,7 +79,7 @@ func (f *Field) Set(x, y, v int) { f.lx = f.lx + f.x - x f.x = x } - if f.lx-f.x < x { + if f.lx < x-f.x+1 { f.lx = x - f.x + 1 } } -- cgit v1.2.3