chiark / gitweb /
Switch hhints loop in emit_hints() so it counts forwards
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 16 Nov 2024 23:39:30 +0000 (23:39 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 16 Nov 2024 23:39:30 +0000 (23:39 +0000)
Now that it only touches the input array once, it's much simpler to do
the y-axis inversion there.

bedstead.c

index 6af85239c1518a80b7dfb38d2958c9c3b506f28b..20f048c820f4100ec42cf9a1c7f003ed2486df7d 100644 (file)
@@ -3849,10 +3849,10 @@ emit_hints(int vstems[XSIZE], int ledges[XSIZE], int redges[XSIZE],
 
        select_hints(YSIZE, hstems, tedges, bedges, hhints);
        cur = DESCENT * YPIX; printed = false;
-       for (i = YSIZE - 1; i >= 0; i--) {
-               switch (hhints[i]) {
+       for (i = 0; i < YSIZE; i++) {
+               switch (hhints[YSIZE - 1 - i]) {
                case hint_stem:
-                       start = (YSIZE - i - 1) * YPIX_S;
+                       start = i * YPIX_S;
                        size = YPIX_S;
                        break;
                default: continue;