changeset 66:3df72ae19981

Fixed a minor display bug that could occur as the result of my last commit.
author Atul Varma <varmaa@toolness.com>
date Fri, 16 May 2008 18:22:12 -0700
parents f380e3b3785d
children 41c698849ec9
files console.js web-zui.js
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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("&nbsp;");
       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 += "</span>";
--- 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