Quellcode durchsuchen

* Improve rotation output by avoiding white-on-black attributes to appear

due to spaces.
tags/v0.99.beta14
Sam Hocevar sam vor 17 Jahren
Ursprung
Commit
95f28cd883
1 geänderte Dateien mit 15 neuen und 0 gelöschten Zeilen
  1. +15
    -0
      cucul/transform.c

+ 15
- 0
cucul/transform.c Datei anzeigen

@@ -293,6 +293,13 @@ int cucul_rotate_left(cucul_canvas_t *cv)
attr2 = cv->attrs[cv->width * y + x * 2 + 1];
}

/* If one of the characters is a space, we simply ignore
* its colour attributes. Otherwise the resulting characters
* may have totally wrong colours. */
if(pair[0] == ' ')
attr1 = attr2;
else if(pair[1] == ' ')
attr2 = attr1;

leftpair(pair);

@@ -403,6 +410,14 @@ int cucul_rotate_right(cucul_canvas_t *cv)
attr2 = cv->attrs[cv->width * y + x * 2 + 1];
}

/* If one of the characters is a space, we simply ignore
* its colour attributes. Otherwise the resulting characters
* may have totally wrong colours. */
if(pair[0] == ' ')
attr1 = attr2;
else if(pair[1] == ' ')
attr2 = attr1;

rightpair(pair);

newchars[(h2 * x + h2 - 1 - y) * 2] = pair[0];


Laden…
Abbrechen
Speichern