Skip to content

Commit 7124db9

Browse files
committed
Revert "adjust code a bit"
This reverts commit c65200c.
1 parent 12929c6 commit 7124db9

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/framework/components/element/text-element.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,6 @@ Object.assign(pc, function () {
276276
var ti = i % this._font.textures[0].length;
277277
var p = (i - ti) / this._font.textures[0].length;
278278

279-
if (multiPassNeeded) {
280-
this._meshInfo[i].renderPass = passes[p];
281-
} else {
282-
this._meshInfo[i].renderPass = RenderPass.ALL_IN_ONE;
283-
}
284-
285279
if (!this._meshInfo[i]) {
286280
this._meshInfo[i] = new MeshInfo();
287281
} else {
@@ -292,10 +286,21 @@ Object.assign(pc, function () {
292286
mi.setParameter("font_pxrange", this._getPxRange(this._font));
293287
mi.setParameter("font_textureWidth", this._font.data.info.maps[ti].width);
294288

295-
mi.setParameter("render_pass", this._meshInfo[i].renderPass);
296-
this._setTextureParams(mi, this._font.textures[0][ti], (multiPassNeeded) ? this._font.textures[1][ti]: null);
289+
if (multiPassNeeded) {
290+
this._setTextureParams(mi, this._font.textures[0][ti], this._font.textures[1][ti]);
291+
mi.setParameter("render_pass", passes[p]);
292+
} else {
293+
this._setTextureParams(mi, this._font.textures[0][ti], null);
294+
mi.setParameter("render_pass", RenderPass.ALL_IN_ONE);
295+
}
297296
}
298297
}
298+
299+
if (multiPassNeeded) {
300+
this._meshInfo[i].renderPass = passes[p];
301+
} else {
302+
this._meshInfo[i].renderPass = RenderPass.ALL_IN_ONE;
303+
}
299304
}
300305

301306
// destroy any excess mesh instances

0 commit comments

Comments
 (0)