more fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-06-21 01:31:04 +03:00
parent 286d19237d
commit 787167ee51
2 changed files with 14 additions and 3 deletions

View File

@ -111,17 +111,20 @@ var SingleImageActions = actions.Actions({
var viewer = this.ribbons.viewer
var images = viewer.find('.ribbon .image')
var img = this.ribbons.getImage()[0] || images[0]
// no images loaded...
if(!img){
if(images.length == 0){
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 w = parseFloat(s.width)
var h = parseFloat(s.height)
//*/
var w = this.ribbons.getVisibleImageSize('width', 1)
var h = this.ribbons.getVisibleImageSize('height', 1)
// inner diameter
var di = Math.min(h, w)

View File

@ -668,6 +668,14 @@ var RibbonsPrototype = {
.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...
scale = scale || this.scale()