# HG changeset patch # User Atul Varma # Date 1210987332 25200 # Node ID 3df72ae19981ca261ccf318ad0d28c32fb9593d0 # Parent f380e3b3785d88a7f6c3409427fcb9e7d8bd1eb6 Fixed a minor display bug that could occur as the result of my last commit. diff -r f380e3b3785d -r 3df72ae19981 console.js --- a/console.js Fri May 16 18:15:27 2008 -0700 +++ b/console.js Fri May 16 18:22:12 2008 -0700 @@ -1,6 +1,6 @@ function Console(width, height, element, observer) { - this._width = width; - this._height = height; + this.width = width; + this.height = height; this._element = element; this._pos = [0, 0]; this._observer = observer; @@ -9,7 +9,7 @@ Console.prototype = { resize: function(height) { - var linesAdded = height - this._height; + var linesAdded = height - this.height; if (linesAdded == 0) return; @@ -22,7 +22,7 @@ else for (y = 0; y < -linesAdded; y++) this._delRow(); - this._height = height; + this.height = height; this.render(); }, @@ -34,7 +34,7 @@ _addRow: function() { var charRow = []; var styleRow = []; - for (var x = 0; x < this._width; x++) { + for (var x = 0; x < this.width; x++) { charRow.push(" "); styleRow.push(null); } @@ -45,7 +45,7 @@ clear: function() { this._characters = []; this._styles = []; - for (var y = 0; y < this._height; y++) + for (var y = 0; y < this.height; y++) this._addRow(); this.render(); }, @@ -80,9 +80,9 @@ render: function() { var string = ""; - for (var y = 0; y < this._height; y++) { + for (var y = 0; y < this.height; y++) { var currStyle = null; - for (var x = 0; x < this._width; x++) { + for (var x = 0; x < this.width; x++) { if (this._styles[y][x] !== currStyle) { if (currStyle !== null) string += ""; diff -r f380e3b3785d -r 3df72ae19981 web-zui.js --- a/web-zui.js Fri May 16 18:15:27 2008 -0700 +++ b/web-zui.js Fri May 16 18:22:12 2008 -0700 @@ -257,7 +257,7 @@ numlines, $("#top-window").get(0), self); - } else { + } else if (self._console.height != numlines) { // Z-Machine games are peculiar in regards to the way they // sometimes overlay quotations on top of the current text; // we basically want to preserve any text that is already in