@xterm/addon-webgl 0.20.0-beta.275 → 0.20.0-beta.277
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/addon-webgl.js +1 -1
- package/lib/addon-webgl.js.map +1 -1
- package/lib/addon-webgl.mjs +1 -1
- package/lib/addon-webgl.mjs.map +2 -2
- package/package.json +3 -3
- package/src/TextureAtlas.ts +22 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/addon-webgl",
|
|
3
|
-
"version": "0.20.0-beta.
|
|
3
|
+
"version": "0.20.0-beta.277",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "The xterm.js authors",
|
|
6
6
|
"url": "https://xtermjs.org/"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"prepublishOnly": "npm run package",
|
|
24
24
|
"start": "node ../../demo/start"
|
|
25
25
|
},
|
|
26
|
-
"commit": "
|
|
26
|
+
"commit": "596634ac4189852a15d0178e49201fc7d52c968d",
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@xterm/xterm": "^6.1.0-beta.
|
|
28
|
+
"@xterm/xterm": "^6.1.0-beta.278"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/TextureAtlas.ts
CHANGED
|
@@ -1080,17 +1080,33 @@ class AtlasPage {
|
|
|
1080
1080
|
size: number,
|
|
1081
1081
|
sourcePages?: AtlasPage[]
|
|
1082
1082
|
) {
|
|
1083
|
-
if (sourcePages) {
|
|
1084
|
-
for (const p of sourcePages) {
|
|
1085
|
-
this._glyphs.push(...p.glyphs);
|
|
1086
|
-
this._usedPixels += p._usedPixels;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
1083
|
this.canvas = createCanvas(document, size, size);
|
|
1090
1084
|
// The canvas needs alpha because we use clearColor to convert the background color to alpha.
|
|
1091
1085
|
// It might also contain some characters with transparent backgrounds if allowTransparency is
|
|
1092
1086
|
// set.
|
|
1093
1087
|
this.ctx = throwIfFalsy(this.canvas.getContext('2d', { alpha: true }));
|
|
1088
|
+
if (sourcePages) {
|
|
1089
|
+
if (sourcePages.length === 4) {
|
|
1090
|
+
// optimized for quadmerge
|
|
1091
|
+
this._glyphs = this._glyphs.concat(
|
|
1092
|
+
sourcePages[0].glyphs,
|
|
1093
|
+
sourcePages[1].glyphs,
|
|
1094
|
+
sourcePages[2].glyphs,
|
|
1095
|
+
sourcePages[3].glyphs
|
|
1096
|
+
);
|
|
1097
|
+
this._usedPixels = sourcePages[0]._usedPixels +
|
|
1098
|
+
sourcePages[1]._usedPixels +
|
|
1099
|
+
sourcePages[2]._usedPixels +
|
|
1100
|
+
sourcePages[3]._usedPixels;
|
|
1101
|
+
} else {
|
|
1102
|
+
// fallback for non quadmerges (should never be used)
|
|
1103
|
+
for (let i = 0; i < sourcePages.length; ++i) {
|
|
1104
|
+
this._glyphs = this._glyphs.concat(sourcePages[i].glyphs);
|
|
1105
|
+
this._usedPixels += sourcePages[i]._usedPixels;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1094
1110
|
}
|
|
1095
1111
|
|
|
1096
1112
|
public clear(): void {
|