mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 15:13:36 +00:00
Fix wrong early char size computation
This commit is contained in:
@@ -47,7 +47,9 @@ module.exports = (grunt) ->
|
||||
butterfly:
|
||||
'coffees/*.coffee'
|
||||
|
||||
watch:
|
||||
watch:
|
||||
options:
|
||||
livereload: true
|
||||
coffee:
|
||||
files: [
|
||||
'coffees/*.coffee'
|
||||
|
||||
9
build.sh
9
build.sh
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
2
butterfly/static/main.min.js
vendored
2
butterfly/static/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "butterfly",
|
||||
"version": "1.4.5",
|
||||
"version": "1.5.2",
|
||||
"description": "A sleek web based terminal emulator",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
Reference in New Issue
Block a user