Skip to content

Commit

Permalink
Merge pull request #5099 from AnalyticalGraphicsInc/pin-builder-alpha
Browse files Browse the repository at this point in the history
Fix leaky alpha values coming from pinBuilder
  • Loading branch information
mramato authored Mar 13, 2017
2 parents 512a0ac + 1405550 commit e21278b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit e21278b

Please sign in to comment.