fixed current image indicator scaling...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-06-19 16:22:59 +03:00
parent c53f7c4eda
commit 8f96973726

View File

@ -164,14 +164,15 @@ var CurrentImageIndicatorActions = actions.Actions({
}, },
updateCurrentImageIndicator: ['- Interface/Update current image indicator', updateCurrentImageIndicator: ['- Interface/Update current image indicator',
function(target, update_border){ function(target, update_border, scale){
var ribbon_set = this.ribbons.getRibbonSet() var ribbon_set = this.ribbons.getRibbonSet()
if(ribbon_set.length == 0){ if(ribbon_set.length == 0){
return return
} }
var scale = this.scale scale = scale || this.scale
var cur = this.ribbons.getImage(target) var cur = this.ribbons.getImage(target)
// NOTE: cur may be unloaded... // NOTE: cur may be unloaded...
var ribbon = this.ribbons.getRibbon(cur.length > 0 ? target : this.currentRibbon) var ribbon = this.ribbons.getRibbon(cur.length > 0 ? target : this.currentRibbon)
@ -244,7 +245,8 @@ var CurrentImageIndicatorActions = actions.Actions({
// set border right away... // set border right away...
if(update_border == 'before'){ if(update_border == 'before'){
css.borderWidth = border //css.borderWidth = border
marker.css({ borderWidth: border })
// set border with a delay... // set border with a delay...
// NOTE: this is to prevent the ugly border resize before // NOTE: this is to prevent the ugly border resize before
@ -328,8 +330,11 @@ module.CurrentImageIndicator = core.ImageGridFeatures.Feature({
w1 = w1 || 1 w1 = w1 || 1
w0 > w1 w0 > w1
&& this.updateCurrentImageIndicator(null, 'before') && this.updateCurrentImageIndicator(null,
//&& console.log('BEFORE!!!!') 'before',
// NOTE: we need to get the target scale as we
// have not started resizing yet...
(w0 / w1) * this.scale)
}], }],
['resizingDone', ['resizingDone',
function(){ function(){