fixed shadow image with scaling...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-10-17 15:11:23 +04:00
parent 019956c777
commit 4f5b432c08
2 changed files with 18 additions and 7 deletions

View File

@ -31,12 +31,16 @@
overflow: visible; overflow: visible;
width: auto; width: auto;
height: auto; height: auto;
background: black; background: black;
-webkit-transition: all 0.1s ease-in; -webkit-transition: all 0.1s ease-in;
-moz-transition: all 0.1s ease-in; -moz-transition: all 0.1s ease-in;
transition: all 0.1s ease-in; transition: all 0.1s ease-in;
} }
.shadow .image {
transform-origin: 0 0;
}
.image.moving { .image.moving {
visibility: hidden; visibility: hidden;
} }

View File

@ -314,22 +314,29 @@ module.RibbonsPrototype = {
}, },
// XXX make this work for multiple targets... // XXX make this work for multiple targets...
// XXX avoid ardcoded delays... // XXX avoid hardcoded delays...
makeShadow: function(target, animate){ makeShadow: function(target, animate){
var img = this.getImage(target) var img = this.getImage(target)
var gid = this.getElemGID(img) var gid = this.getElemGID(img)
var s = this.getScale()
var shadow = $('<div>') var shadow = $('<div>')
.addClass('shadow') .addClass('shadow')
.append(img .append(setElementScale(
.clone() img
.removeClass('current') .clone()
.attr('gid', null)) .removeClass('current')
.css(img.offset()) .attr('gid', null), s))
.css({
width: img.width()*s,
height: img.height()*s,
})
.css(img.offset())
.appendTo(this.viewer) .appendTo(this.viewer)
img.addClass('moving') img.addClass('moving')
var that = this var that = this
return function(){ return function(){
var s = that.getScale()
var img = that.getImage(gid) var img = that.getImage(gid)
if(animate){ if(animate){
shadow.css(img.offset()) shadow.css(img.offset())