Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove redundant param for writeTextToCanvas #12376

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,4 @@ 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)
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
10 changes: 0 additions & 10 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,14 +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;
Expand Down Expand Up @@ -211,7 +202,6 @@ function rebindAllGlyphs(labelCollection, label) {
Color.WHITE,
0.0,
LabelStyle.FILL,
verticalOrigin,
);

glyphTextureInfo = new GlyphTextureInfo(
Expand Down
Loading