commit 585ce525dc4dedc92fb7c9cd4a8f36d3d9ac721f
parent 94d55c376f5921dd3841baef011f353b07189596
Author: ssnf <ssnf@ssnf.xyz>
Date: Thu, 19 May 2022 00:39:28 +0000
Fixed frame update when using change(). Improved fr_calc() conditions.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sim.c b/sim.c
@@ -272,6 +272,7 @@ change(int arg)
str_delete(f->s, f->dot.p0, f->dot.p1);
}
f->dot.p0 = f->dot.p1 = f->dot.p0;
+ fr_zero(fr);
insert(0);
if (s.n)
str_insert(&buf->ds[f->i], &s, 0);
@@ -605,8 +606,8 @@ fr_calc(Frame* fr)
|| f->dot.p1 != f->dot.p0
|| f->dot.p1 < fr->a[0].p0
|| f->dot.p1 > fr->a[fr->n ? fr->n - 1 : 0].p1
- || (fr->dot < half && fr->a[0].p0 && fr->n < w.wy * 3)
- || (fr->dot + half + 1 > fr->n && fr->a[fr->n ? fr->n - 1 : 0].p1 + 1 != f->s->n)
+ || (fr->dot < half && fr->a[0].p0)
+ || (fr->dot + half + 1 > fr->n && fr->a[fr->n ? fr->n - 1 : 0].p1 + 1 < f->s->n)
) {
fr_zero(fr);
for (p0 = f->dot.p1; p0; --p0)