aboutsummaryrefslogtreecommitdiff
path: root/pkg/field/set.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-10-01 13:34:58 +0200
committerJulien Dessaux2021-10-01 13:35:20 +0200
commit2f66ddcb912ebf031594427b149c5acb83fa7693 (patch)
treee4b1668df92680e2531fdd04ee4e2fc4215f1422 /pkg/field/set.go
parentRefactoring (diff)
downloadgofunge98-2f66ddcb912ebf031594427b149c5acb83fa7693.tar.gz
gofunge98-2f66ddcb912ebf031594427b149c5acb83fa7693.tar.bz2
gofunge98-2f66ddcb912ebf031594427b149c5acb83fa7693.zip
Fixed resizing bugs in certain situations not covered by mycology
Diffstat (limited to '')
-rw-r--r--pkg/field/set.go10
1 files changed, 5 insertions, 5 deletions
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
}
}