mirror of
https://github.com/nuintun/command-manager.git
synced 2025-07-01 12:42:43 +08:00
update files
This commit is contained in:
parent
84c3f92511
commit
26e7ce4c22
@ -13,7 +13,7 @@ function textRepeat(text, n){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function CanvasXTerm(font){
|
function CanvasXTerm(font){
|
||||||
this.font = font || { family: 'Consolas', lineHeight: 23, size: 14, color: '#fff' };
|
this.font = font || { family: 'Consolas', lineHeight: 20, size: 13, color: '#fff' };
|
||||||
this.canvas = document.createElement('canvas');
|
this.canvas = document.createElement('canvas');
|
||||||
this.canvas.style.backgroundColor = 'transparent';
|
this.canvas.style.backgroundColor = 'transparent';
|
||||||
this.brush = this.canvas.getContext('2d');
|
this.brush = this.canvas.getContext('2d');
|
||||||
@ -41,7 +41,7 @@ CanvasXTerm.prototype = {
|
|||||||
|
|
||||||
for (i = 0; i < rows; i++) {
|
for (i = 0; i < rows; i++) {
|
||||||
x = 0;
|
x = 0;
|
||||||
y = i * 20 + this.baseY;
|
y = i * this.font.lineHeight + this.baseY;
|
||||||
|
|
||||||
for (j = 0; j < cols; j++) {
|
for (j = 0; j < cols; j++) {
|
||||||
node = screen[i][j];
|
node = screen[i][j];
|
||||||
@ -139,6 +139,14 @@ CanvasXTerm.prototype = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* draw underline
|
||||||
|
* @param brush
|
||||||
|
* @param fromX
|
||||||
|
* @param toX
|
||||||
|
* @param Y
|
||||||
|
* @param foreground
|
||||||
|
*/
|
||||||
function underline(brush, fromX, toX, Y, foreground){
|
function underline(brush, fromX, toX, Y, foreground){
|
||||||
brush.save();
|
brush.save();
|
||||||
brush.translate(0, parseInt(Y) === Y ? 0.5 : 0);
|
brush.translate(0, parseInt(Y) === Y ? 0.5 : 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user