mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-17 10:01:08 +00:00
Merge pull request #2720 from asturur/rotatedgroup
shift click with generally transformed active groups
This commit is contained in:
commit
3336c625a7
1 changed files with 11 additions and 9 deletions
|
|
@ -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 };
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue