Fix wrong early char size computation

This commit is contained in:
Florian Mounier
2014-05-19 11:47:41 +02:00
parent 80cfc39f07
commit e80b5f192d
8 changed files with 16 additions and 13 deletions

View File

@@ -47,7 +47,9 @@ module.exports = (grunt) ->
butterfly:
'coffees/*.coffee'
watch:
watch:
options:
livereload: true
coffee:
files: [
'coffees/*.coffee'

View File

@@ -1,9 +0,0 @@
#!/bin/sh
compass compile --force -e production butterfly/static
coffee -cb -j butterfly/static/javascripts/main.js \
butterfly/static/coffees/term.coffee \
butterfly/static/coffees/selection.coffee \
butterfly/static/coffees/virtual_input.coffee \
butterfly/static/coffees/main.coffee
uglifyjs butterfly/static/javascripts/main.js -c -m -o butterfly/static/javascripts/main.js

View File

@@ -14,7 +14,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '1.5.1'
__version__ = '1.5.2'
import os

View File

@@ -85,6 +85,7 @@
});
}
this.initmouse();
setTimeout(this.resize.bind(this), 100);
}
Terminal.prototype.reset_vars = function() {
@@ -1307,6 +1308,7 @@
var ch, el, i, j, line, old_cols, old_rows, term_size;
old_cols = this.cols;
old_rows = this.rows;
this.compute_char_size();
term_size = this.parent.getBoundingClientRect();
this.cols = Math.floor(term_size.width / this.char_size.width) - 1;
this.rows = Math.floor(term_size.height / this.char_size.height);
@@ -2882,6 +2884,8 @@
return console.log("" + n + " chars + colors in " + ((new Date()).getTime() - t0) + " ms");
};
window.butterfly = term;
}).call(this);
//# sourceMappingURL=main.js.map

File diff suppressed because one or more lines are too long

View File

@@ -87,3 +87,6 @@ cbench = (n=100000000) ->
t0 = (new Date()).getTime()
term.write rnd
console.log "#{n} chars + colors in #{(new Date()).getTime() - t0} ms"
window.butterfly = term

View File

@@ -114,6 +114,8 @@ class Terminal
@initmouse()
setTimeout(@resize.bind(@), 100)
reset_vars: ->
@ybase = 0
@ydisp = 0
@@ -1393,6 +1395,7 @@ class Terminal
resize: ->
old_cols = @cols
old_rows = @rows
@compute_char_size()
term_size = @parent.getBoundingClientRect()
@cols = Math.floor(term_size.width / @char_size.width) - 1 # ?
@rows = Math.floor(term_size.height / @char_size.height)

View File

@@ -1,6 +1,6 @@
{
"name": "butterfly",
"version": "1.4.5",
"version": "1.5.2",
"description": "A sleek web based terminal emulator",
"repository": {
"type": "git",