mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-17 15:23:14 +03:00
Addressing seams in transparent images on Firefox
This commit is contained in:
parent
f803fb9ad4
commit
db71054978
11
src/tile.js
11
src/tile.js
@ -353,8 +353,15 @@ $.Tile.prototype = {
|
|||||||
//an image with an alpha channel, then the only way
|
//an image with an alpha channel, then the only way
|
||||||
//to avoid seeing the tile underneath is to clear the rectangle
|
//to avoid seeing the tile underneath is to clear the rectangle
|
||||||
if (context.globalAlpha === 1 && this._hasTransparencyChannel()) {
|
if (context.globalAlpha === 1 && this._hasTransparencyChannel()) {
|
||||||
//clearing only the inside of the rectangle occupied
|
if ($.Browser.vendor === $.BROWSERS.FIREFOX) {
|
||||||
//by the png prevents edge flikering
|
// Round to the nearest whole pixel so we don't get seams from overlap. This is only
|
||||||
|
// an issue on Firefox, so we only do it there.
|
||||||
|
position.x = Math.round(position.x);
|
||||||
|
position.y = Math.round(position.y);
|
||||||
|
size.x = Math.round(size.x);
|
||||||
|
size.y = Math.round(size.y);
|
||||||
|
}
|
||||||
|
|
||||||
context.clearRect(
|
context.clearRect(
|
||||||
position.x,
|
position.x,
|
||||||
position.y,
|
position.y,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user