mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-19 17:21:50 +03:00
Save and restore inside of the drawer
This commit is contained in:
parent
3ce7024e97
commit
6677953d87
@ -310,14 +310,16 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.saveContext();
|
||||
if ( typeof fillStyle === "function" ) {
|
||||
this.context.fillStyle = fillStyle(this.context);
|
||||
}
|
||||
else {
|
||||
this.context.fillStyle = fillStyle;
|
||||
}
|
||||
|
||||
this.context.fillRect(rect.x, rect.y, rect.width, rect.height);
|
||||
this.restoreContext();
|
||||
},
|
||||
|
||||
// private
|
||||
|
@ -1172,12 +1172,8 @@ function drawTiles( tiledImage, lastDrawn ) {
|
||||
}
|
||||
|
||||
if ( tiledImage.placeholderFillStyle && lastDrawn.length === 0 ) {
|
||||
tiledImage._drawer.saveContext();
|
||||
|
||||
var placeholderRect = tiledImage._drawer.viewportToDrawerRectangle(tiledImage.getBounds(true));
|
||||
tiledImage._drawer.drawPlaceholder(placeholderRect, tiledImage.placeholderFillStyle);
|
||||
|
||||
tiledImage._drawer.restoreContext();
|
||||
}
|
||||
|
||||
for ( i = lastDrawn.length - 1; i >= 0; i-- ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user