Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-26 02:49:06 +03:00
parent 8ad1b95399
commit 68bc67aed1
4 changed files with 15 additions and 22 deletions

View File

@ -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',
},

View File

@ -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
}
}],

View File

@ -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',

View File

@ -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: '',
})
}