Commit e15247d3 authored by SergeyLuzyanin's avatar SergeyLuzyanin

fix Bug 34583

parent d59b845a
......@@ -2594,6 +2594,22 @@ CGraphicObjects.prototype =
this.resetSelection();
var i, j, nearest_pos, cur_group, sp_tree, sp, parent_paragraph, page_num;
var a_objects = [];
var arrCenterPos = [], aPos;
for(i = 0; i < ungroup_arr.length; ++i)
{
cur_group = ungroup_arr[i];
sp_tree = cur_group.spTree;
aPos = [];
for(j = 0; j < sp_tree.length; ++j)
{
sp = sp_tree[j];
xc = sp.transform.TransformPointX(sp.extX/2, sp.extY/2);
yc = sp.transform.TransformPointY(sp.extX/2, sp.extY/2);
aPos.push({xc: xc, yc: yc});
}
arrCenterPos.push(aPos);
}
for(i = 0; i < ungroup_arr.length; ++i)
{
cur_group = ungroup_arr[i];
......@@ -2603,14 +2619,21 @@ CGraphicObjects.prototype =
cur_group.parent.Remove_FromDocument(false);
cur_group.setBDeleted(true);
sp_tree = cur_group.spTree;
aPos = arrCenterPos[i];
for(j = 0; j < sp_tree.length; ++j)
{
sp = sp_tree[j];
var drawing = new ParaDrawing(0, 0, sp_tree[j], this.drawingDocument, null, null);
var xc, yc, hc = sp.extX/2, vc = sp.extY/2;
xc = sp.transform.TransformPointX(hc, vc);
yc = sp.transform.TransformPointY(hc, vc);
if(aPos && aPos[j]){
xc = aPos[j].xc;
yc = aPos[j].yc;
}
else {
xc = sp.transform.TransformPointX(hc, vc);
yc = sp.transform.TransformPointY(hc, vc);
}
drawing.Set_GraphicObject(sp);
sp.setParent(drawing);
......
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