diff --git a/ui/TODO.otl b/ui/TODO.otl index dde714dc..341c729a 100755 --- a/ui/TODO.otl +++ b/ui/TODO.otl @@ -93,8 +93,8 @@ Roadmap -[_] 27% Gen 3 current todo - [_] 55% High priority +[_] 28% Gen 3 current todo + [_] 56% High priority [_] 33% mormalize ribbons -- top-align sorted chunks [X] basic mechanics | splitData(...) @@ -102,6 +102,9 @@ Roadmap | alignDataToRibbon(...) | shiftRibbonBy(...) [_] manual invoke mechanics + | ctrl-s is a good candidate + | + | NOTE: might need a good preview to make this understandable... [_] auto-invoke mechanics [_] update data set... | - add new images to the set @@ -321,6 +324,7 @@ Roadmap [_] remove extra and repetitive actions [_] caching config [_] side-by side view... + [X] BUG: scaling #2 in single image mode fits image to screen on wide screens [X] BUG: cropping in cropped mode will not save the whole data... [X] 100% BUG: sometimes the previews are not updated... [X] wrong resolution preview is loaded diff --git a/ui/base.js b/ui/base.js index bc992344..dad182fa 100755 --- a/ui/base.js +++ b/ui/base.js @@ -983,8 +983,7 @@ function resetToOriginalImage(image){ // NOTE: fixed_proportions if true will make this set the size using the // image square, disregarding actual proportions. // NOTE: fixed_proportions may result in and image bleading off screen. -// XXX needs more testing... -function fitNImages(n, fixed_proportions){ +function fitNImages(n, fixed_proportions, no_strict_fit){ var viewer = $('.viewer') viewer.trigger('preFittingImages', [n]) @@ -1004,10 +1003,17 @@ function fitNImages(n, fixed_proportions){ var W = viewer.innerWidth() var H = viewer.innerHeight() - // XXX this may not work correctly for portrait proportioned viewers... var scale = Math.min(W / (w * n), H / h) - // NOTE: if animating, the next two likes must be animated together... + // special case: unless fitting one image to screen, do not fill the + // whole height... + // NOTE: we do not need to check width as it's already used for + // scaling... + if(!no_strict_fit && n != 1 && h*scale == H){ + scale *= 0.8 + } + + // NOTE: if animating, the next two lines must be animated together... setElementScale($('.ribbon-set'), scale) centerView(image, 'css') @@ -1017,10 +1023,7 @@ function fitNImages(n, fixed_proportions){ } -// NOTE: here we measure image height as width may change depending on -// proportions... function zoomIn(){ - //var w = getScreenWidthInImages(getVisibleImageSize('height')) var w = getScreenWidthInImages() if(w > 1){ w = w / ZOOM_SCALE @@ -1028,7 +1031,6 @@ function zoomIn(){ } } function zoomOut(){ - //var w = getScreenWidthInImages(getVisibleImageSize('height')) var w = getScreenWidthInImages() if(w <= MAX_SCREEN_IMAGES){ w = w * ZOOM_SCALE diff --git a/ui/keybindings.js b/ui/keybindings.js index acf1c97f..051f99e7 100755 --- a/ui/keybindings.js +++ b/ui/keybindings.js @@ -444,6 +444,7 @@ var KEYBOARD_CONFIG = { // zooming... '#1': doc('Fit image to screen', function(){ fitNImages(1) }), + // XXX this will do different stuff for different proportioned screens... '#2': doc('Show big image', function(){ fitNImages(1.5, true) }), '#3': doc('Show small image', function(){ fitNImages(3, true) }),