Commit f127105d authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47616 954022d7-b5bf-4e40-9824-e11837661b57
parent f09308d6
......@@ -130,7 +130,6 @@ DrawingObjectsController.prototype =
grouped_objects.push(selected_objects[i]);
}
}
if(grouped_objects.length < 2)
return null;
......@@ -140,7 +139,7 @@ DrawingObjectsController.prototype =
max_y = bounds.maxY;
min_x = bounds.minX;
min_y = bounds.minY;
for(i = 0; i < grouped_objects.length; ++i)
for(i = 1; i < grouped_objects.length; ++i)
{
bounds = grouped_objects[i].getBoundsInGroup();
if(max_x < bounds.maxX)
......@@ -155,12 +154,14 @@ DrawingObjectsController.prototype =
var group = new CGroupShape(drawingBase, this.drawingObjects);
group.setPosition(min_x, min_y);
group.setExtents(max_x - min_x, max_y - min_y);
group.setChildExtents(max_x - min_x, max_y - min_y);
for(i = 0; i < grouped_objects.length; ++i)
{
grouped_objects[i].setPosition(grouped_objects[i].x - min_x, grouped_objects.y - min_y);
group.addToSpTree(grouped_objects[i]);
}
group.recalculate();
return group;
},
canGroup: function()
......
......@@ -99,6 +99,12 @@ CGroupShape.prototypr =
this.spPr.xfrm.rot = rot;
},
setChildExtents: function(chExtX, chExtY)
{
this.spPr.xfrm.chExtX = chExtX;
this.spPr.xfrm.chExtY = chExtY;
},
updateDrawingBaseCoordinates: function()
{
......@@ -203,16 +209,18 @@ CGroupShape.prototypr =
return {kd1: 1, kd2: 1};
},
draw: function(graphics)
{
for(var i = 0; i < this.spTree.length; ++i)
this.spTree[i].draw(graphics);
},
recalculate: function()
{
if(this.recalcInfo.recalculateTransform)
this.re
this.recalcInfo =
{
recalculateTransform: true,
recalculateArrGraphicObjects: true
};
this.recalculateTransform();
if(this.recalcInfo.recalculateArrGraphicObjects)
this.recalculateArrGraphicObjects();
},
recalculateArrGraphicObjects: function()
......@@ -274,6 +282,10 @@ CGroupShape.prototypr =
global_MatrixTransformer.MultiplyAppend(this.transform, this.group.getTransform());
}
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree.recalculateTransform();
}
},
......
......@@ -91,7 +91,7 @@ function NullState(drawingObjectsController, drawingObjects)
{
this.drawingObjectsController.addPreTrackObject(selected_objects[j].createMoveTrack());
}
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects, x, y, e.shiftKey, e.ctrl, selected_objects[i].isGroup() ? selected_objects[i] : null));
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects, x, y, e.shiftKey, e.ctrl, selected_objects[i].isGroup() ? selected_objects[i] : null, true));
return;
}
}
......@@ -392,14 +392,8 @@ function MoveState(drawingObjectsController, drawingObjects, startX, startY, rec
{
var dx = x - this.startX;
var dy = y - this.startY;
var dx2 = 0, dy2 = 0;
var check_position = this.drawingObjects.checkGraphicObjectPosition(this.rectX + dx, this.rectY + dy, this.rectW, this.rectH);
if(check_position.result === false)
{
dx2 = check_position.x;
dy2 = check_position.y;
}
this.drawingObjectsController.trackMoveObjects(dx + dx2, dy + dy2);
this.drawingObjectsController.trackMoveObjects(dx + check_position.x, dy + check_position.y);
this.drawingObjects.showOverlayGraphicObjects();
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment