Skip to content

Commit

Permalink
Merge pull request #9219 from CesiumGS/pr/9196
Browse files Browse the repository at this point in the history
Fix JSDoc/TS of `writeTextToCanvas`
  • Loading branch information
Omar Shehata authored Nov 1, 2020
2 parents f265296 + e3b55f3 commit 97463fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
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");

0 comments on commit 97463fd

Please sign in to comment.