mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8ad1b95399
commit
68bc67aed1
@ -72,9 +72,9 @@ module.GLOBAL_KEYBOARD = {
|
||||
|
||||
// XXX use a means to scale that does not get affected by image
|
||||
// proportions...
|
||||
'#1': 'fitImage: 1 -- Fit image to screen',
|
||||
'#2': 'fitImage: 2 -- Show image with frame',
|
||||
'#3': 'fitImage: 5 -- Show small image',
|
||||
'#1': 'fitScreen',
|
||||
'#2': 'fitNormal',
|
||||
'#3': 'fitSmall',
|
||||
|
||||
Esc: 'toggleSingleImage: "off" -- Exit single image view',
|
||||
},
|
||||
|
||||
@ -72,15 +72,11 @@ var core = require('features/core')
|
||||
// . .
|
||||
// + - - - - - - - - - +
|
||||
//
|
||||
// XXX might be a good idea to use tiles for zoomed in images...
|
||||
//
|
||||
// NOTE: this in part does the same job as .ribbons.correctImageProportionsForRotation(..)
|
||||
//
|
||||
// XXX might be a good idea to use tiles for zoomed in images...
|
||||
// XXX should this be an action???
|
||||
// XXX alignment issues in rotated images...
|
||||
// ...this makes .ribbons.centerImage() / .ribbons.centerRibbon()
|
||||
// do things incorreclty in single image mode...
|
||||
// NOTE: they do their job correctly on rectangular images in
|
||||
// ribbon view!
|
||||
// XXX this makes exiting single image mode align image incorrectly...
|
||||
function updateImageProportions(){
|
||||
var that = this
|
||||
var threshold = this.config['single-image-proportions-threshold']
|
||||
@ -297,6 +293,7 @@ module.SingleImageView = core.ImageGridFeatures.Feature({
|
||||
.each(function(_, img){
|
||||
img.style.width = ''
|
||||
img.style.height = ''
|
||||
|
||||
img.style.margin = ''
|
||||
})
|
||||
|
||||
@ -335,12 +332,11 @@ module.SingleImageViewLocalStorage = core.ImageGridFeatures.Feature({
|
||||
return
|
||||
}
|
||||
|
||||
console.log('!!!!!!!!!!!!!!', this.config['ribbon-scale'])
|
||||
|
||||
if(this.toggleSingleImage('?') == 'on'){
|
||||
this.scale = this.config['single-image-scale'] || this.scale
|
||||
|
||||
} else {
|
||||
// XXX for some reason this stopped working...
|
||||
this.scale = this.config['ribbon-scale'] || this.scale
|
||||
}
|
||||
}],
|
||||
|
||||
@ -577,7 +577,6 @@ module.ViewerActions = actions.Actions({
|
||||
// ...this is done to add ability to control scroll indication.
|
||||
//
|
||||
// XXX make these neutral to screen and image proportions...
|
||||
// ...use .scale instead of .screenwidth???
|
||||
fitImage: ['Zoom/Fit image',
|
||||
function(count, overflow){
|
||||
if(count != null){
|
||||
@ -598,11 +597,11 @@ module.ViewerActions = actions.Actions({
|
||||
// similar across platforms...
|
||||
// ...for this we need to get display dpi...
|
||||
fitSmall: ['Zoom/Show small image',
|
||||
function(){ }],
|
||||
function(){ this.fitImage(5, 0) }],
|
||||
fitNormal: ['Zoom/Show normal image',
|
||||
function(){ }],
|
||||
function(){ this.fitImage(1.5, 0) }],
|
||||
fitScreen: ['Zoom/Fit image to screen',
|
||||
function(){ }],
|
||||
function(){ this.fitImage(1, 0) }],
|
||||
|
||||
|
||||
fitRibbon: ['Zoom/Fit ribbon vertically',
|
||||
|
||||
@ -2191,18 +2191,16 @@ var RibbonsPrototype = {
|
||||
image.css({
|
||||
width: h,
|
||||
height: w,
|
||||
})
|
||||
image.css({
|
||||
'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){
|
||||
image.css({
|
||||
width: h,
|
||||
height: w,
|
||||
})
|
||||
image.css({
|
||||
'margin': '',
|
||||
|
||||
margin: '',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user