mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
9ade2d1dda
commit
0fdea710a7
@ -2257,24 +2257,27 @@ var RibbonsPrototype = {
|
|||||||
// non-square image...
|
// non-square image...
|
||||||
if(w != h){
|
if(w != h){
|
||||||
|
|
||||||
|
// NOTE: we need to use the default (CSS) value when
|
||||||
|
// possible, to avoid sizing issues...
|
||||||
|
var dfl_w = image[0].style.width == ''
|
||||||
|
var dfl_h = image[0].style.height == ''
|
||||||
|
|
||||||
var image_p = w > h ? 'landscape' : 'portrait'
|
var image_p = w > h ? 'landscape' : 'portrait'
|
||||||
|
|
||||||
// when the image is turned 90deg/270deg and its
|
// when the image is turned 90deg/270deg and its
|
||||||
// proportions are the same as the screen...
|
// proportions are the same as the screen...
|
||||||
if((o == 90 || o == 270) && image_p == viewer_p){
|
if((o == 90 || o == 270) && image_p == viewer_p){
|
||||||
image.css({
|
image.css({
|
||||||
width: h,
|
width: dfl_h ? '' : h,
|
||||||
height: w,
|
height: dfl_w ? '' : w,
|
||||||
|
|
||||||
margin: -((w - h)/2) +'px '+ (w - h)/2 + 'px'
|
margin: -((w - h)/2) +'px '+ (w - h)/2 + 'px'
|
||||||
})
|
})
|
||||||
|
|
||||||
} else if((o == 0 || o == 180) && image_p != viewer_p){
|
} else if((o == 0 || o == 180) && image_p != viewer_p){
|
||||||
image.css({
|
image.css({
|
||||||
//width: h,
|
width: dfl_h ? '' : h,
|
||||||
//height: w,
|
height: dfl_w ? '' : w,
|
||||||
width: '',
|
|
||||||
height: '',
|
|
||||||
|
|
||||||
margin: '',
|
margin: '',
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user