mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 14:53:14 +03:00
fixed edge smoothing to work with clipping and placeholderFillRect - #755
This commit is contained in:
parent
515c15bf98
commit
7eda39c9a9
@ -201,6 +201,21 @@ $.Rect.prototype = /** @lends OpenSeadragon.Rect.prototype */{
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Translate/move this Rect by a vector and return new Rect.
|
||||
* @function
|
||||
* @param {OpenSeadragon.Point} delta The translation vector.
|
||||
* @returns {OpenSeadragon.Rect} A new rect with altered position
|
||||
*/
|
||||
translate: function( delta ) {
|
||||
return new OpenSeadragon.Rect(
|
||||
this.x + delta.x,
|
||||
this.y + delta.y,
|
||||
this.width,
|
||||
this.height
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the smallest rectangle that will contain this and the given rectangle.
|
||||
* @param {OpenSeadragon.Rect} rect
|
||||
|
@ -1327,6 +1327,12 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
|
||||
var box = tiledImage.imageToViewportRectangle(tiledImage._clip, true);
|
||||
var clipRect = tiledImage._drawer.viewportToDrawerRectangle(box);
|
||||
if (sketchScale) {
|
||||
clipRect = clipRect.times(sketchScale);
|
||||
}
|
||||
if (sketchTranslate) {
|
||||
clipRect = clipRect.translate(sketchTranslate);
|
||||
}
|
||||
tiledImage._drawer.setClip(clipRect, useSketch);
|
||||
|
||||
usedClip = true;
|
||||
@ -1334,6 +1340,12 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
|
||||
if ( tiledImage.placeholderFillStyle && tiledImage._hasOpaqueTile === false ) {
|
||||
var placeholderRect = tiledImage._drawer.viewportToDrawerRectangle(tiledImage.getBounds(true));
|
||||
if (sketchScale) {
|
||||
placeholderRect = placeholderRect.times(sketchScale);
|
||||
}
|
||||
if (sketchTranslate) {
|
||||
placeholderRect = placeholderRect.translate(sketchTranslate);
|
||||
}
|
||||
|
||||
var fillStyle = null;
|
||||
if ( typeof tiledImage.placeholderFillStyle === "function" ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user