mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
more fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
286d19237d
commit
787167ee51
@ -111,17 +111,20 @@ var SingleImageActions = actions.Actions({
|
|||||||
|
|
||||||
var viewer = this.ribbons.viewer
|
var viewer = this.ribbons.viewer
|
||||||
var images = viewer.find('.ribbon .image')
|
var images = viewer.find('.ribbon .image')
|
||||||
var img = this.ribbons.getImage()[0] || images[0]
|
|
||||||
|
|
||||||
// no images loaded...
|
// no images loaded...
|
||||||
if(!img){
|
if(images.length == 0){
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//* XXX these do not account for margins....
|
/* XXX these do not account for margins....
|
||||||
|
var img = this.ribbons.getImage()[0] || images[0]
|
||||||
var s = getComputedStyle(img)
|
var s = getComputedStyle(img)
|
||||||
var w = parseFloat(s.width)
|
var w = parseFloat(s.width)
|
||||||
var h = parseFloat(s.height)
|
var h = parseFloat(s.height)
|
||||||
|
//*/
|
||||||
|
var w = this.ribbons.getVisibleImageSize('width', 1)
|
||||||
|
var h = this.ribbons.getVisibleImageSize('height', 1)
|
||||||
|
|
||||||
// inner diameter
|
// inner diameter
|
||||||
var di = Math.min(h, w)
|
var di = Math.min(h, w)
|
||||||
|
|||||||
@ -668,6 +668,14 @@ var RibbonsPrototype = {
|
|||||||
.appendTo(this.viewer)
|
.appendTo(this.viewer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// account for image rotation...
|
||||||
|
// NOTE: this way we do not need to account for margins...
|
||||||
|
var o = img.attr('orientation')
|
||||||
|
o = o == null ? 0 : o
|
||||||
|
dim = o == 0 || o == 180 ? dim
|
||||||
|
// swap width/height when image is rotated +/- 90deg...
|
||||||
|
: dim == 'height' ? 'width'
|
||||||
|
: 'height'
|
||||||
|
|
||||||
// do the calc...
|
// do the calc...
|
||||||
scale = scale || this.scale()
|
scale = scale || this.scale()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user