Merge pull request #2720 from asturur/rotatedgroup

shift click with generally transformed active groups
This commit is contained in:
Juriy Zaytsev 2016-01-04 14:52:27 -08:00
commit 3336c625a7

View file

@ -275,22 +275,24 @@
*/
_normalizePointer: function (object, pointer) {
var activeGroup = this.getActiveGroup(),
x = pointer.x,
y = pointer.y,
isObjectInGroup = (
activeGroup &&
object.type !== 'group' &&
activeGroup.contains(object)),
lt;
lt, m;
if (isObjectInGroup) {
lt = fabric.util.transformPoint(activeGroup.getCenterPoint(), this.viewportTransform, true);
x -= lt.x;
y -= lt.y;
x /= activeGroup.scaleX;
y /= activeGroup.scaleY;
m = fabric.util.multiplyTransformMatrices(
this.viewportTransform,
activeGroup.calcTransformMatrix());
m = fabric.util.invertTransform(m);
pointer = fabric.util.transformPoint(pointer, m , false);
lt = fabric.util.transformPoint(activeGroup.getCenterPoint(), m , false);
pointer.x -= lt.x;
pointer.y -= lt.y;
}
return { x: x, y: y };
return { x: pointer.x, y: pointer.y };
},
/**