securityos/node_modules/xterm-addon-webgl/out/CharDataCompat.js

21 lines
797 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var CellData_1 = require("common/buffer/CellData");
function getCompatAttr(bufferLine, index) {
var cell = new CellData_1.CellData();
bufferLine.loadCell(index, cell);
var oldBg = cell.getBgColor() === -1 ? 256 : cell.getBgColor();
var oldFg = cell.getFgColor() === -1 ? 256 : cell.getFgColor();
var oldAttr = (cell.isBold() ? 1 : 0) |
(cell.isUnderline() ? 2 : 0) |
(cell.isBlink() ? 4 : 0) |
(cell.isInverse() ? 8 : 0) |
(cell.isDim() ? 32 : 0) |
(cell.isItalic() ? 64 : 0);
var attrCompat = oldBg |
(oldFg << 9) |
(oldAttr << 18);
return attrCompat;
}
exports.getCompatAttr = getCompatAttr;
//# sourceMappingURL=CharDataCompat.js.map