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

Fix JSDoc/TS of writeTextToCanvas #9219

Merged
merged 2 commits into from
Nov 1, 2020
Merged
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
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

### 1.75 - 2020-11-02

- Fixed JSDoc and TypeScript type definitions for `writeTextToCanvas` which listed incorrect return type. [#9196](https://github.com/CesiumGS/cesium/pull/9196)

### 1.74 - 2020-10-01

##### Additions :tada:
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/writeTextToCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var imageSmoothingEnabledName;
* @param {Number} [options.strokeWidth=1] The stroke width.
* @param {Color} [options.backgroundColor=Color.TRANSPARENT] The background color of the canvas.
* @param {Number} [options.padding=0] The pixel size of the padding to add around the text.
* @returns {HTMLCanvasElement} A new canvas with the given text drawn into it. The dimensions object
* @returns {HTMLCanvasElement|undefined} A new canvas with the given text drawn into it. The dimensions object
* from measureText will also be added to the returned canvas. If text is
* blank, returns undefined.
* @function writeTextToCanvas
Expand Down
5 changes: 4 additions & 1 deletion Specs/TypeScript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
CheckerboardMaterialProperty,
CircleGeometry,
CircleOutlineGeometry,
ColorMaterialProperty,
Color,
ColorMaterialProperty,
CompositeMaterialProperty,
CompositePositionProperty,
CompositeProperty,
Expand Down Expand Up @@ -97,6 +97,7 @@ import {
WallOutlineGeometry,
WebMapServiceImageryProvider,
WebMapTileServiceImageryProvider,
writeTextToCanvas,
} from "cesium";

// Verify ImageryProvider instances conform to the expected interface
Expand Down Expand Up @@ -384,3 +385,5 @@ geometryInstance = new GeometryInstance({
positions: [],
}),
});

const canvas: HTMLCanvasElement | undefined = writeTextToCanvas("test");