Skip to content

Commit

Permalink
Merge pull request #12376 from ibreathebsb/main
Browse files Browse the repository at this point in the history
feat: remove redundant param for `writeTextToCanvas`
  • Loading branch information
jjspace authored Jan 10, 2025
2 parents eed5ddb + ac57264 commit 49b9d39
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,5 +419,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [Kirn Kim](https://github.com/squrki)
- [Emanuele Mastaglia](https://github.com/Masty88)
- [Connor Manning](https://github.com/connormanning)
- [Isaac Young](https://github.com/ibreathebsb)
- [Nick Crews](https://github.com/NickCrews)
- [胡文康](https://github.com/XiaoHu1994)
1 change: 0 additions & 1 deletion packages/engine/Source/Core/writeTextToCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ let imageSmoothingEnabledName;
* @param {string} text The text to write.
* @param {object} [options] Object with the following properties:
* @param {string} [options.font='10px sans-serif'] The CSS font to use.
* @param {string} [options.textBaseline='bottom'] The baseline of the text.
* @param {boolean} [options.fill=true] Whether to fill the text.
* @param {boolean} [options.stroke=false] Whether to stroke the text.
* @param {Color} [options.fillColor=Color.WHITE] The fill color.
Expand Down
11 changes: 0 additions & 11 deletions packages/engine/Source/Scene/LabelCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ function createGlyphCanvas(
outlineColor,
outlineWidth,
style,
verticalOrigin,
) {
writeTextToCanvasParameters.font = font;
writeTextToCanvasParameters.fillColor = fillColor;
Expand All @@ -77,15 +76,6 @@ function createGlyphCanvas(
// Setting the padding to something bigger is necessary to get enough space for the outlining.
writeTextToCanvasParameters.padding = SDFSettings.PADDING;

if (verticalOrigin === VerticalOrigin.CENTER) {
writeTextToCanvasParameters.textBaseline = "middle";
} else if (verticalOrigin === VerticalOrigin.TOP) {
writeTextToCanvasParameters.textBaseline = "top";
} else {
// VerticalOrigin.BOTTOM and VerticalOrigin.BASELINE
writeTextToCanvasParameters.textBaseline = "bottom";
}

writeTextToCanvasParameters.fill =
style === LabelStyle.FILL || style === LabelStyle.FILL_AND_OUTLINE;
writeTextToCanvasParameters.stroke =
Expand Down Expand Up @@ -211,7 +201,6 @@ function rebindAllGlyphs(labelCollection, label) {
Color.WHITE,
0.0,
LabelStyle.FILL,
verticalOrigin,
);

glyphTextureInfo = new GlyphTextureInfo(
Expand Down

0 comments on commit 49b9d39

Please sign in to comment.