From 749caa9e261d40c6af7f2516d3d3a3c30ae95f9a Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 1 Oct 2021 17:24:09 +0200 Subject: Fixed some more resizing bugs in certain situations not covered by mycology --- pkg/field/set.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg/field/set.go') diff --git a/pkg/field/set.go b/pkg/field/set.go index c4cf2a4..2b30652 100644 --- a/pkg/field/set.go +++ b/pkg/field/set.go @@ -13,6 +13,13 @@ func (f *Field) Set(x, y, v int) { l.x = x l.l = 1 l.columns = append(l.columns, v) + if f.x > x { + f.lx = f.lx + f.x - x + f.x = x + } + if f.lx < x-f.x+1 { + f.lx = x - f.x + 1 + } } else if x >= l.x { if x < l.x+l.l { // just set the value -- cgit v1.2.3