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 leaky alpha values coming from pinBuilder #5099

Merged
merged 2 commits into from
Mar 13, 2017
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 @@ -8,6 +8,7 @@ Change Log
* Fix crunch compressed textures in IE11. [#5057](https://github.com/AnalyticalGraphicsInc/cesium/pull/5057)
* Fixed a bug in `Quaternion.fromHeadingPitchRoll` that made it erroneously throw an exception when passed individual angles in an unminified / debug build.
* Fix `GroundPrimitive` rendering in 2D and Columbus View [#5078](https://github.com/AnalyticalGraphicsInc/cesium/pull/5078)
* Fixed an issue with `PinBuilder` where inset images could have low-alpha fringes against an opaque background. [#5099](https://github.com/AnalyticalGraphicsInc/cesium/pull/5099)
* Fixed a bug in `ModelAnimationCache` causing different animations to reference the same animation. [#5064](https://github.com/AnalyticalGraphicsInc/cesium/pull/5064)

### 1.31 - 2017-03-01
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/PinBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ define([
}

//x and y are the center of the pin box
var x = (size - sizeX) / 2;
var y = ((7 / 24) * size) - (sizeY / 2);
var x = Math.round((size - sizeX) / 2);
var y = Math.round(((7 / 24) * size) - (sizeY / 2));

context2D.globalCompositeOperation = 'destination-out';
context2D.drawImage(image, x - 1, y, sizeX, sizeY);
Expand All @@ -182,14 +182,14 @@ define([

context2D.globalCompositeOperation = 'destination-over';
context2D.fillStyle = Color.BLACK.toCssColorString();
context2D.fillRect(x - 1, y - 1, sizeX + 1, sizeY + 1);
context2D.fillRect(x - 1, y - 1, sizeX + 2, sizeY + 2);

context2D.globalCompositeOperation = 'destination-out';
context2D.drawImage(image, x, y, sizeX, sizeY);

context2D.globalCompositeOperation = 'destination-over';
context2D.fillStyle = Color.WHITE.toCssColorString();
context2D.fillRect(x, y, sizeX, sizeY);
context2D.fillRect(x - 1, y - 2, sizeX + 2, sizeY + 2);
}

var stringifyScratch = new Array(4);
Expand Down