Stop coverting v's into ^'s (Closes #55) (#72)

This commit is contained in:
Aleksandr Levchuk 2017-01-21 06:58:37 -08:00 committed by Lewis Hemens
parent a5c725853f
commit f9e489c737
1 changed files with 4 additions and 7 deletions

View File

@ -320,7 +320,7 @@ export default class State {
*/
fromText(value, offset) {
var lines = value.split('\n');
var middle = new Vector(0, Math.round(lines.length / 2));
var middle = new ascii.Vector(0, Math.round(lines.length / 2));
for (var j = 0; j < lines.length; j++) {
middle.x = Math.max(middle.x, Math.round(lines[j].length / 2));
}
@ -331,13 +331,10 @@ export default class State {
// Convert special output back to special chars.
// TODO: This is a horrible hack, need to handle multiple special chars
// correctly and preserve them through line drawing etc.
if (c.SPECIAL_VALUES.indexOf(char) != -1) {
char = c.SPECIAL_VALUE;
if (SPECIAL_VALUES.indexOf(char) != -1) {
char = SPECIAL_VALUE;
}
if (c.ALT_SPECIAL_VALUES.indexOf(char) != -1) {
char = c.ALT_SPECIAL_VALUE;
}
this.drawValue(new Vector(i, j).add(offset).subtract(middle), char);
this.drawValue(new ascii.Vector(i, j).add(offset).subtract(middle), char);
}
}
}