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 Label backgroundPadding and backgroundColor #8949

Merged
merged 4 commits into from
Jun 15, 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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Fixed JSDoc and TypeScript type definitions for `Viewer` options parameters.
- Fixed a memory leak where some 3D Tiles requests were being unintentionally retained after the requests were cancelled. [#8843](https://github.com/CesiumGS/cesium/pull/8843)
- Fixed a bug with handling of PixelFormat's flipY. [#8893](https://github.com/CesiumGS/cesium/pull/8893)
- Fixed handling of Label's backgroundColor and backgroundPadding option [#8949](https://github.com/CesiumGS/cesium/8949)

### 1.70.0 - 2020-06-01

Expand Down
12 changes: 6 additions & 6 deletions Source/Scene/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import VerticalOrigin from "./VerticalOrigin.js";
var fontInfoCache = {};
var fontInfoCacheLength = 0;
var fontInfoCacheMaxSize = 256;
var defaultBackgroundColor = new Color(0.165, 0.165, 0.165, 0.8);
var defaultBackgroundPadding = new Cartesian2(7, 5);

var textTypes = Object.freeze({
LTR: 0,
Expand Down Expand Up @@ -165,13 +167,11 @@ function Label(options, labelCollection) {
);
this._outlineWidth = defaultValue(options.outlineWidth, 1.0);
this._showBackground = defaultValue(options.showBackground, false);
this._backgroundColor = defaultValue(
options.backgroundColor,
new Color(0.165, 0.165, 0.165, 0.8)
this._backgroundColor = Color.clone(
defaultValue(options.backgroundColor, defaultBackgroundColor)
);
this._backgroundPadding = defaultValue(
options.backgroundPadding,
new Cartesian2(7, 5)
this._backgroundPadding = Cartesian2.clone(
defaultValue(options.backgroundPadding, defaultBackgroundPadding)
);
this._style = defaultValue(options.style, LabelStyle.FILL);
this._verticalOrigin = defaultValue(
Expand Down