Closed marcoancona closed 7 years ago
If constrainTo is set to 'parent' and the parent is scaled with transform: scale(), the constraints are broken: http://codepen.io/marcoancona/pen/ZQYGVN
constrainTo
transform: scale()
Problem is that in
Pep.prototype.handleConstraint = function(dx, dy, accountForTranslation) { var pos = this.$el.position();
pos has new scaled position while container and element width are the original ones.
Suggested fix:
Pep.prototype.handleConstraint = function(dx, dy, accountForTranslation) { var pos = this.$el.position(); this.pos.x = pos.left / this.scale; this.pos.y = pos.top / this.scale;
If
constrainTo
is set to 'parent' and the parent is scaled withtransform: scale()
, the constraints are broken: http://codepen.io/marcoancona/pen/ZQYGVNProblem is that in
pos has new scaled position while container and element width are the original ones.
Suggested fix: