Skip to content

Commit

Permalink
Fixed update_lines bug in delete_line.
Browse files Browse the repository at this point in the history
  • Loading branch information
jory committed Feb 14, 2011
1 parent 0344cc3 commit 1e46406
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions ttyplayer.js
Expand Up @@ -242,7 +242,7 @@ function TTYPlayer () {
}
}

for (var j = point.y; j <= HEIGHT; j++) {
for (var j = point.y + 1; j <= HEIGHT; j++) {
update_lines[j] = true;
}
}
Expand Down Expand Up @@ -338,13 +338,17 @@ function TTYPlayer () {
if (isNaN(n)) n = 1;

buffer.splice(point.y - 1, n);
init_rows(n);

if (update_lines['-1'] == undefined) {
for (var i = 0; i < n; i++) {
for (var i = 0; point.y + i <= HEIGHT; i++) {
update_lines[(point.y + i)] = true;
}
}

var offset = HEIGHT - n;
for (var j = 0; offset + j < HEIGHT; j++) {
buffer.push([]);
}
};

var delete_character = function(n) {
Expand Down Expand Up @@ -699,7 +703,9 @@ function TTYPlayer () {

console.log('Wait ' + millisec + ' milliseconds.');

timeout = window.setTimeout(play_data, millisec);
if (index < 14) {
timeout = window.setTimeout(play_data, millisec);
}
};

var stop_data = function() {
Expand Down Expand Up @@ -794,7 +800,7 @@ $().ready(
BinaryAjax('Bebop.ttyrec',
function (data) {
p.parse_data(data);
p.set_frame(5);
p.set_frame(5);
p.play_data();
});
});
Expand Down

0 comments on commit 1e46406

Please sign in to comment.