aboutsummaryrefslogtreecommitdiff
path: root/pkg/field/set.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-10-01 17:24:09 +0200
committerJulien Dessaux2021-10-01 18:42:39 +0200
commit749caa9e261d40c6af7f2516d3d3a3c30ae95f9a (patch)
tree510be574191d6057ed26c1cc48d649c7d0f4dca4 /pkg/field/set.go
parentFixed resizing bugs in certain situations not covered by mycology (diff)
downloadgofunge98-749caa9e261d40c6af7f2516d3d3a3c30ae95f9a.tar.gz
gofunge98-749caa9e261d40c6af7f2516d3d3a3c30ae95f9a.tar.bz2
gofunge98-749caa9e261d40c6af7f2516d3d3a3c30ae95f9a.zip
Fixed some more resizing bugs in certain situations not covered by mycology
Diffstat (limited to '')
-rw-r--r--pkg/field/set.go7
1 files changed, 7 insertions, 0 deletions
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