mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 23:03:13 +03:00
removed overlayplacement.js and moved it's only relevant object literal directly into overlay.js
This commit is contained in:
parent
7cac08a2f4
commit
97d2f0c765
@ -1,14 +1,30 @@
|
|||||||
|
|
||||||
(function( $ ){
|
(function( $ ){
|
||||||
|
|
||||||
|
|
||||||
|
$.OverlayPlacement = {
|
||||||
|
CENTER: 0,
|
||||||
|
TOP_LEFT: 1,
|
||||||
|
TOP: 2,
|
||||||
|
TOP_RIGHT: 3,
|
||||||
|
RIGHT: 4,
|
||||||
|
BOTTOM_RIGHT: 5,
|
||||||
|
BOTTOM: 6,
|
||||||
|
BOTTOM_LEFT: 7,
|
||||||
|
LEFT: 8
|
||||||
|
};
|
||||||
|
|
||||||
$.Overlay = function(elmt, loc, placement) {
|
$.Overlay = function(elmt, loc, placement) {
|
||||||
this.elmt = elmt;
|
this.elmt = elmt;
|
||||||
this.scales = (loc instanceof $.Rect);
|
this.scales = (loc instanceof $.Rect);
|
||||||
this.bounds = new $.Rect(loc.x, loc.y, loc.width, loc.height);
|
this.bounds = new $.Rect(loc.x, loc.y, loc.width, loc.height);
|
||||||
this.placement = loc instanceof $.Point ? placement : $.OverlayPlacement.TOP_LEFT; // rects are always top-left
|
|
||||||
this.position = new $.Point(loc.x, loc.y);
|
this.position = new $.Point(loc.x, loc.y);
|
||||||
this.size = new $.Point(loc.width, loc.height);
|
this.size = new $.Point(loc.width, loc.height);
|
||||||
this.style = elmt.style;
|
this.style = elmt.style;
|
||||||
|
// rects are always top-left
|
||||||
|
this.placement = loc instanceof $.Point ?
|
||||||
|
placement :
|
||||||
|
$.OverlayPlacement.TOP_LEFT;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.Overlay.prototype = {
|
$.Overlay.prototype = {
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
(function( $ ){
|
|
||||||
|
|
||||||
$.OverlayPlacement = function() {
|
|
||||||
throw Error.invalidOperation();
|
|
||||||
};
|
|
||||||
|
|
||||||
$.OverlayPlacement = {
|
|
||||||
CENTER: 0,
|
|
||||||
TOP_LEFT: 1,
|
|
||||||
TOP: 2,
|
|
||||||
TOP_RIGHT: 3,
|
|
||||||
RIGHT: 4,
|
|
||||||
BOTTOM_RIGHT: 5,
|
|
||||||
BOTTOM: 6,
|
|
||||||
BOTTOM_LEFT: 7,
|
|
||||||
LEFT: 8
|
|
||||||
};
|
|
||||||
|
|
||||||
}( OpenSeadragon ));
|
|
Loading…
x
Reference in New Issue
Block a user