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

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49525 954022d7-b5bf-4e40-9824-e11837661b57
parent 31820ea4
...@@ -2099,9 +2099,9 @@ function CDrawingDocument() ...@@ -2099,9 +2099,9 @@ function CDrawingDocument()
} }
// вот здесь весь трекинг // вот здесь весь трекинг
this.DrawTrack = function(type, matrix, left, top, width, height, isLine) this.DrawTrack = function(type, matrix, left, top, width, height, isLine, canRotate)
{ {
this.AutoShapesTrack.DrawTrack(type, matrix, left, top, width, height, isLine); this.AutoShapesTrack.DrawTrack(type, matrix, left, top, width, height, isLine,canRotate);
} }
this.LockSlide = function(slideNum) this.LockSlide = function(slideNum)
......
...@@ -25,7 +25,7 @@ function CGroupShape(parent) ...@@ -25,7 +25,7 @@ function CGroupShape(parent)
this.selected = false; this.selected = false;
this.arrGraphicObjects = []; this.arrGraphicObjects = [];
this.selectionArray = []; this.selectedObjects = [];
this.recalcInfo = this.recalcInfo =
{ {
...@@ -34,7 +34,8 @@ function CGroupShape(parent) ...@@ -34,7 +34,8 @@ function CGroupShape(parent)
recalculateTransform: true, recalculateTransform: true,
recalculateSpTree: true, recalculateSpTree: true,
recalculateCursorTypes: true, recalculateCursorTypes: true,
recalculateScaleCoefficients: true recalculateScaleCoefficients: true,
recalculateArrGraphicObjects: true
}; };
this.scaleCoefficients = this.scaleCoefficients =
...@@ -52,6 +53,11 @@ function CGroupShape(parent) ...@@ -52,6 +53,11 @@ function CGroupShape(parent)
CGroupShape.prototype = CGroupShape.prototype =
{ {
isSimpleObject: function()
{
return false;
},
recalcAll: function() recalcAll: function()
{ {
this.recalcInfo = this.recalcInfo =
...@@ -124,6 +130,41 @@ CGroupShape.prototype = ...@@ -124,6 +130,41 @@ CGroupShape.prototype =
return this.arrGraphicObjects; return this.arrGraphicObjects;
}, },
getInvertTransform: function()
{
return this.invertTransform;
},
getRectBounds: function()
{
var transform = this.getTransformMatrix();
var w = this.extX;
var h = this.extY;
var rect_points = [{x:0, y:0}, {x: w, y: 0}, {x: w, y: h}, {x: 0, y: h}];
var min_x, max_x, min_y, max_y;
min_x = transform.TransformPointX(rect_points[0].x, rect_points[0].y);
min_y = transform.TransformPointY(rect_points[0].x, rect_points[0].y);
max_x = min_x;
max_y = min_y;
var cur_x, cur_y;
for(var i = 1; i < 4; ++i)
{
cur_x = transform.TransformPointX(rect_points[i].x, rect_points[i].y);
cur_y = transform.TransformPointY(rect_points[i].x, rect_points[i].y);
if(cur_x < min_x)
min_x = cur_x;
if(cur_x > max_x)
max_x = cur_x;
if(cur_y < min_y)
min_y = cur_y;
if(cur_y > max_y)
max_y = cur_y;
}
return {minX: min_x, maxX: max_x, minY: min_y, maxY: max_y};
},
getResultScaleCoefficients: function() getResultScaleCoefficients: function()
{ {
if(this.recalcInfo.recalculateScaleCoefficients) if(this.recalcInfo.recalculateScaleCoefficients)
...@@ -189,10 +230,61 @@ CGroupShape.prototype = ...@@ -189,10 +230,61 @@ CGroupShape.prototype =
this.recalculateTransform(); this.recalculateTransform();
recalcInfo.recalculateTransform = false; recalcInfo.recalculateTransform = false;
} }
if(recalcInfo.recalculateArrGraphicObjects)
this.recalculateArrGraphicObjects();
for(var i = 0; i < this.spTree.length; ++i) for(var i = 0; i < this.spTree.length; ++i)
this.spTree[i].recalculate(); this.spTree[i].recalculate();
}, },
recalcTransform:function()
{
this.recalcInfo.recalculateTransform = true;
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].recalcTransform)
this.spTree[i].recalcTransform();
else
{
this.spTree[i].recalcInfo.recalculateTransform = true;
this.spTree[i].recalcInfo.recalculateTransformText = true;
}
}
},
canRotate: function()
{
return true;
},
canResize: function()
{
return true;//TODO
},
canMove: function()
{
return true;//TODO
},
canGroup: function()
{
return true;//TODO
},
canChangeAdjustments: function()
{
return false;
},
drawAdjustments: function()
{},
hitToAdjustment: function()
{
return {hit: false};
},
recalculateBrush: function() recalculateBrush: function()
{}, {},
...@@ -200,7 +292,21 @@ CGroupShape.prototype = ...@@ -200,7 +292,21 @@ CGroupShape.prototype =
{}, {},
recalculateArrGraphicObjects: function() recalculateArrGraphicObjects: function()
{}, {
this.arrGraphicObjects.length = 0;
for(var i = 0; i < this.spTree.length; ++i)
{
if(!this.spTree[i].isGroup())
this.arrGraphicObjects.push(this.spTree[i]);
else
{
var arr_graphic_objects = this.spTree[i].getArrGraphicObjects();
for(var j = 0; j < arr_graphic_objects.length; ++j)
this.arrGraphicObjects.push(arr_graphic_objects[j]);
}
}
},
applyAllAlign: function(val) applyAllAlign: function(val)
...@@ -452,6 +558,146 @@ CGroupShape.prototype = ...@@ -452,6 +558,146 @@ CGroupShape.prototype =
} }
}, },
getResizeCoefficients: function(numHandle, x, y)
{
var cx, cy;
cx= this.extX > 0 ? this.extX : 0.01;
cy= this.extY > 0 ? this.extY : 0.01;
var invert_transform = this.getInvertTransform();
var t_x = invert_transform.TransformPointX(x, y);
var t_y = invert_transform.TransformPointY(x, y);
switch(numHandle)
{
case 0:
return {kd1: (cx-t_x)/cx, kd2: (cy-t_y)/cy};
case 1:
return {kd1: (cy-t_y)/cy, kd2: 0};
case 2:
return {kd1: (cy-t_y)/cy, kd2: t_x/cx};
case 3:
return {kd1: t_x/cx, kd2: 0};
case 4:
return {kd1: t_x/cx, kd2: t_y/cy};
case 5:
return {kd1: t_y/cy, kd2: 0};
case 6:
return {kd1: t_y/cy, kd2:(cx-t_x)/cx};
case 7:
return {kd1:(cx-t_x)/cx, kd2: 0};
}
return {kd1: 1, kd2: 1};
},
setXfrm: function(offX, offY, extX, extY, rot, flipH, flipV)
{
if(this.spPr.xfrm.isNotNull())
{
if(isRealNumber(offX) && isRealNumber(offY))
this.setOffset(offX, offY);
if(isRealNumber(extX) && isRealNumber(extY))
this.setExtents(extX, extY);
if(isRealNumber(rot))
this.setRotate(rot);
if(isRealBool(flipH) && isRealBool(flipV))
this.setFlips(flipH, flipV);
}
else
{
var transform = this.getTransform();
if(isRealNumber(offX) && isRealNumber(offY))
this.setOffset(offX, offY);
else
this.setOffset(transform.x, transform.y);
if(isRealNumber(extX) && isRealNumber(extY))
this.setExtents(extX, extY);
else
this.setExtents(transform.extX, transform.extY);
if(isRealNumber(rot))
this.setRotate(rot);
else
this.setRotate(transform.rot);
if(isRealBool(flipH) && isRealBool(flipV))
this.setFlips(flipH, flipV);
else
this.setFlips(transform.flipH, transform.flipV);
}
},
setRotate: function(rot)
{
var xfrm = this.spPr.xfrm;
History.Add(this, {Type: historyitem_SetShapeRot, oldRot: xfrm.rot, newRot: rot});
this.recalcTransform();
this.recalcInfo.recalculateTransformText = true;
xfrm.rot = rot;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setOffset: function(offX, offY)
{
History.Add(this, {Type: historyitem_SetShapeOffset, oldOffsetX: this.spPr.xfrm.offX, newOffsetX: offX, oldOffsetY: this.spPr.xfrm.offY, newOffsetY: offY});
this.spPr.xfrm.offX = offX;
this.spPr.xfrm.offY = offY;
this.recalcTransform();
this.recalcInfo.recalculateTransformText = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setExtents: function(extX, extY)
{
History.Add(this, {Type: historyitem_SetShapeExtents, oldExtentX: this.spPr.xfrm.extX, newExtentX: extX, oldExtentY: this.spPr.xfrm.extY, newExtentY: extY});
this.spPr.xfrm.extX = extX;
this.spPr.xfrm.extY = extY;
this.recalcTransform();
this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateGeometry = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setChildOffset: function(offX, offY)
{
History.Add(this, {Type: historyitem_SetShapeChildOffset, oldOffsetX: this.spPr.xfrm.offX, newOffsetX: offX, oldOffsetY: this.spPr.xfrm.offY, newOffsetY: offY});
this.spPr.xfrm.chOffX = offX;
this.spPr.xfrm.chOffY = offY;
this.recalcTransform();
this.recalcInfo.recalculateTransformText = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setChildExtents: function(extX, extY)
{
History.Add(this, {Type: historyitem_SetShapeChildExtents, oldExtentX: this.spPr.xfrm.extX, newExtentX: extX, oldExtentY: this.spPr.xfrm.extY, newExtentY: extY});
this.spPr.xfrm.chExtX = extX;
this.spPr.xfrm.chExtY = extY;
this.recalcTransform();
this.recalcInfo.recalculateTransformText = true;
this.recalcInfo.recalculateGeometry = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
setFlips: function(flipH, flipV)
{
History.Add(this, {Type: historyitem_SetShapeFlips, oldFlipH: this.spPr.xfrm.flipH, newFlipH: flipH, oldFlipV: this.spPr.xfrm.flipV, newFlipV: flipV});
this.spPr.xfrm.flipH = flipH;
this.spPr.xfrm.flipV = flipV;
this.recalcTransform();
this.recalcInfo.recalculateTransformText = true;
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
},
changePresetGeom: function(preset) changePresetGeom: function(preset)
{ {
for(var _shape_index = 0; _shape_index < this.arrGraphicObjects.length; ++_shape_index) for(var _shape_index = 0; _shape_index < this.arrGraphicObjects.length; ++_shape_index)
...@@ -489,14 +735,152 @@ CGroupShape.prototype = ...@@ -489,14 +735,152 @@ CGroupShape.prototype =
getMainGroup: function() getMainGroup: function()
{ {
if(!isRealObject(this.group)) if(!isRealObject(this.group))
return null; return this;
return this.group.getMainGroup();
},
normalize: function()
{
for(var i = 0; i < this.spTree.length; ++i)
{
this.spTree[i].normalize();
}
var new_off_x, new_off_y, new_ext_x, new_ext_y;
var xfrm = this.spPr.xfrm;
if(!isRealObject(this.group))
{
new_off_x = xfrm.offX;
new_off_y = xfrm.offY;
new_ext_x = xfrm.extX;
new_ext_y = xfrm.extY;
}
else
{
var scale_scale_coefficients = this.group.getResultScaleCoefficients();
new_off_x = scale_scale_coefficients.cx*(xfrm.offX - this.group.spPr.xfrm.chOffX);
new_off_y = scale_scale_coefficients.cy*(xfrm.offY - this.group.spPr.xfrm.chOffY);
new_ext_x = scale_scale_coefficients.cx*xfrm.extX;
new_ext_y = scale_scale_coefficients.cy*xfrm.extY;
}
this.setOffset(new_off_x, new_off_y);
this.setExtents(new_ext_x, new_ext_y);
this.setChildExtents(new_ext_x, new_ext_y);
this.setChildOffset(0, 0);
},
var cur_group = this.group; updateCoordinatesAfterInternalResize: function()
while(isRealObject(cur_group.group)) {
cur_group = cur_group.group; for(var i = 0; i < this.spTree.length; ++i)
return cur_group; {
if(this.spTree[i].isGroup())
this.spTree[i].updateCoordinatesAfterInternalResize();
}
var sp_tree = this.spTree;
var min_x, max_x, min_y, max_y;
var sp = sp_tree[0];
var xfrm = sp.spPr.xfrm;
var rot = xfrm.rot == null ? 0 : xfrm.rot;
var xc, yc;
if(rot < Math.PI*0.25 || rot>Math.PI*1.75 || (rot>Math.PI*0.75 && rot<Math.PI*1.25))
{
min_x = xfrm.offX;
min_y = xfrm.offY;
max_x = xfrm.offX + xfrm.extX;
max_y = xfrm.offY + xfrm.extY;
}
else
{
xc = xfrm.offX + xfrm.extX*0.5;
yc = xfrm.offY + xfrm.extY*0.5;
min_x = xc - xfrm.extY*0.5;
min_y = yc - xfrm.extX*0.5;
max_x = xc + xfrm.extY*0.5;
max_y = yc + xfrm.extX*0.5;
}
var cur_max_x, cur_min_x, cur_max_y, cur_min_y;
for(i = 1; i < sp_tree.length; ++i)
{
sp = sp_tree[i];
xfrm = sp.spPr.xfrm;
rot = xfrm.rot == null ? 0 : xfrm.rot;
if(rot < Math.PI*0.25 || rot>Math.PI*1.75 || (rot>Math.PI*0.75 && rot<Math.PI*1.25))
{
cur_min_x = xfrm.offX;
cur_min_y = xfrm.offY;
cur_max_x = xfrm.offX + xfrm.extX;
cur_max_y = xfrm.offY + xfrm.extY;
}
else
{
xc = xfrm.offX + xfrm.extX*0.5;
yc = xfrm.offY + xfrm.extY*0.5;
cur_min_x = xc - xfrm.extY*0.5;
cur_min_y = yc - xfrm.extX*0.5;
cur_max_x = xc + xfrm.extY*0.5;
cur_max_y = yc + xfrm.extX*0.5;
}
if(cur_max_x > max_x)
max_x = cur_max_x;
if(cur_min_x < min_x)
min_x = cur_min_x;
if(cur_max_y > max_y)
max_y = cur_max_y;
if(cur_min_y < min_y)
min_y = cur_min_y;
}
var temp;
var x_min_clear = min_x;
var y_min_clear = min_y;
if(this.spPr.xfrm.flipH === true)
{
temp = max_x;
max_x = this.spPr.xfrm.extX - min_x;
min_x = this.spPr.xfrm.extX - temp;
}
if(this.spPr.xfrm.flipV === true)
{
temp = max_y;
max_y = this.spPr.xfrm.extY - min_y;
min_y = this.spPr.xfrm.extY - temp;
}
var old_x0, old_y0;
var xfrm = this.spPr.xfrm;
var rot = xfrm.rot == null ? 0 : xfrm.rot;
var hc = xfrm.extX*0.5;
var vc = xfrm.extY*0.5;
old_x0 = this.spPr.xfrm.offX + hc - (hc*Math.cos(rot) - vc*Math.sin(rot));
old_y0 = this.spPr.xfrm.offY + vc - (hc*Math.sin(rot) + vc*Math.cos(rot));
var t_dx = min_x*Math.cos(rot) - min_y*Math.sin(rot);
var t_dy = min_x*Math.sin(rot) + min_y*Math.cos(rot);
var new_x0, new_y0;
new_x0 = old_x0 + t_dx;
new_y0 = old_y0 + t_dy;
var new_hc = Math.abs(max_x - min_x)*0.5;
var new_vc = Math.abs(max_y - min_y)*0.5;
var new_xc = new_x0 + (new_hc*Math.cos(rot) - new_vc*Math.sin(rot));
var new_yc = new_y0 + (new_hc*Math.sin(rot) + new_vc*Math.cos(rot));
var pos_x, pos_y;
pos_x = new_xc - new_hc;
pos_y = new_yc - new_vc;
this.setOffset(pos_x, pos_y);
this.setExtents(Math.abs(max_x - min_x), Math.abs(max_y - min_y));
this.setChildExtents(Math.abs(max_x - min_x), Math.abs(max_y - min_y));
for(i = 0; i < sp_tree.length; ++i)
{
sp_tree[i].setOffset(sp_tree[i].spPr.xfrm.offX - x_min_clear, sp_tree[i].spPr.xfrm.offY - y_min_clear);
}
}, },
select: function(drawingObjectsController) select: function(drawingObjectsController)
{ {
this.selected = true; this.selected = true;
...@@ -532,11 +916,162 @@ CGroupShape.prototype = ...@@ -532,11 +916,162 @@ CGroupShape.prototype =
} }
}, },
getParentObjects: function()
{
var parents = {slide: null, layout: null, master: null, theme: null};
switch (this.parent.kind)
{
case SLIDE_KIND:
{
parents.slide = this.parent;
parents.layout = this.parent.Layout;
parents.master = this.parent.Layout.Master;
parents.theme = this.parent.Layout.Master.Theme;
parents.presentation = this.parent.Layout.Master.presentation;
break;
}
case LAYOUT_KIND:
{
parents.layout = this.parent;
parents.master = this.parent.Master;
parents.theme = this.parent.Master.Theme;
parents.presentation = this.parent.Master.presentation;
break;
}
case MASTER_KIND:
{
parents.master = this.parent;
parents.theme = this.parent.Theme;
parents.presentation = this.parent.presentation;
break;
}
}
return parents;
},
getCardDirectionByNum: function(num)
{
var num_north = this.getNumByCardDirection(CARD_DIRECTION_N);
var full_flip_h = this.getFullFlipH();
var full_flip_v = this.getFullFlipV();
var same_flip = !full_flip_h && !full_flip_v || full_flip_h && full_flip_v;
if(same_flip)
return ((num - num_north) + CARD_DIRECTION_N + 8)%8;
return (CARD_DIRECTION_N - (num - num_north)+ 8)%8;
},
getNumByCardDirection: function(cardDirection)
{
var hc = this.extX*0.5;
var vc = this.extY*0.5;
var transform = this.getTransformMatrix();
var y1, y3, y5, y7;
y1 = transform.TransformPointY(hc, 0);
y3 = transform.TransformPointY(this.extX, vc);
y5 = transform.TransformPointY(hc, this.extY);
y7 = transform.TransformPointY(0, vc);
var north_number;
var full_flip_h = this.getFullFlipH();
var full_flip_v = this.getFullFlipV();
switch(Math.min(y1, y3, y5, y7))
{
case y1:
{
north_number = !full_flip_v ? 1 : 5;
break;
}
case y3:
{
north_number = !full_flip_h ? 3 : 7;
break;
}
case y5:
{
north_number = !full_flip_v ? 5 : 1;
break;
}
default:
{
north_number = !full_flip_h ? 7 : 3;
break;
}
}
var same_flip = !full_flip_h && !full_flip_v || full_flip_h && full_flip_v;
if(same_flip)
return (north_number + cardDirection)%8;
return (north_number - cardDirection + 8)%8;
},
getAspect: function(num)
{
var _tmp_x = this.extX != 0 ? this.extX : 0.1;
var _tmp_y = this.extY != 0 ? this.extY : 0.1;
return num === 0 || num === 4 ? _tmp_x/_tmp_y : _tmp_y/_tmp_x;
},
getFullFlipH: function()
{
if(!isRealObject(this.group))
return this.flipH;
else
return this.group.getFullFlipH() ? !this.flipH : this.flipH;
},
getFullFlipV: function()
{
if(!isRealObject(this.group))
return this.flipV;
else
return this.group.getFullFlipV() ? !this.flipV : this.flipV;
},
getFullRotate: function()
{
return !isRealObject(this.group) ? this.rot : this.rot + this.group.getFullRotate();
},
hitInBoundingRect: function(x, y)
{
var invert_transform = this.getInvertTransform();
var x_t = invert_transform.TransformPointX(x, y);
var y_t = invert_transform.TransformPointY(x, y);
var _hit_context = this.getParentObjects().presentation.DrawingDocument.CanvasHitContext;
return (HitInLine(_hit_context, x_t, y_t, 0, 0, this.extX, 0) ||
HitInLine(_hit_context, x_t, y_t, this.extX, 0, this.extX, this.extY)||
HitInLine(_hit_context, x_t, y_t, this.extX, this.extY, 0, this.extY)||
HitInLine(_hit_context, x_t, y_t, 0, this.extY, 0, 0) ||
HitInLine(_hit_context, x_t, y_t, this.extX*0.5, 0, this.extX*0.5, -this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_DISTANCE_ROTATE)));
},
createRotateTrack: function()
{
return new RotateTrackGroup(this);
},
createMoveTrack: function()
{
return new MoveGroupTrack(this);
},
createResizeTrack: function(cardDirection)
{
return new ResizeTrackGroup(this, cardDirection);
},
resetSelection: function(graphicObjects) resetSelection: function(graphicObjects)
{ {
for(var i = this.selectionArray.length - 1; i > -1; --i) for(var i = this.selectedObjects.length - 1; i > -1; --i)
{ {
this.selectionArray[i].deselect(graphicObjects); this.selectedObjects[i].deselect(graphicObjects);
} }
}, },
...@@ -547,48 +1082,101 @@ CGroupShape.prototype = ...@@ -547,48 +1082,101 @@ CGroupShape.prototype =
hitToHandles: function(x, y) hitToHandles: function(x, y)
{ {
var px = this.invertTransform.TransformPointX(x, y); var invert_transform = this.getInvertTransform();
var py = this.invertTransform.TransformPointY(x, y); var t_x, t_y;
var distance = this.drawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS); t_x = invert_transform.TransformPointX(x, y);
var dx, dy; t_y = invert_transform.TransformPointY(x, y);
dx = px; var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS);
dy = py;
if(Math.sqrt(dx*dx + dy*dy) < distance) var sqr_x = t_x*t_y, sqr_y = t_y*t_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 0; return 0;
var width = this.extX; var hc = this.extX*0.5;
var height = this.extY; var dist_x = t_x - hc;
var hc = width*0.5; sqr_x = dist_x*dist_x;
var vc = height*0.5; if(Math.sqrt(sqr_x + sqr_y) < radius)
dx = px - hc;
if(Math.sqrt(dx*dx + dy*dy) < distance)
return 1; return 1;
dx = px - width; dist_x = t_x - this.extX;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 2; return 2;
dy = py - vc; var vc = this.extY*0.5;
if(Math.sqrt(dx*dx + dy*dy) < distance) var dist_y = t_y - vc;
sqr_y = dist_y*dist_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 3; return 3;
dy = py - height; dist_y = t_y - this.extY;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_y = dist_y*dist_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 4; return 4;
dx = px - hc; dist_x = t_x - hc;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 5; return 5;
dx = px; dist_x = t_x;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 6; return 6;
dy = py - vc; dist_y = t_y - vc;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_y = dist_y*dist_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 7; return 7;
var rotate_distance = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_DISTANCE_ROTATE);
dist_y = t_y + rotate_distance;
sqr_y = dist_y*dist_y;
dist_x = t_x - hc;
sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 8;
return -1; return -1;
}
},
getRotateAngle: function(x, y)
{
var transform = this.getTransformMatrix();
var rotate_distance = editor.WordControl.m_oLogicDocument.DrawingDocument.GetMMPerDot(TRACK_DISTANCE_ROTATE);
var hc = this.extX*0.5;
var vc = this.extY*0.5;
var xc_t = transform.TransformPointX(hc, vc);
var yc_t = transform.TransformPointY(hc, vc);
var rot_x_t = transform.TransformPointX(hc, - rotate_distance);
var rot_y_t = transform.TransformPointY(hc, - rotate_distance);
var invert_transform = this.getInvertTransform();
var rel_x = invert_transform.TransformPointX(x, y);
var v1_x, v1_y, v2_x, v2_y;
v1_x = x - xc_t;
v1_y = y - yc_t;
v2_x = rot_x_t - xc_t;
v2_y = rot_y_t - yc_t;
var flip_h = this.getFullFlipH();
var flip_v = this.getFullFlipV();
var same_flip = flip_h && flip_v || !flip_h && !flip_v;
var angle = rel_x > this.extX*0.5 ? Math.atan2( Math.abs(v1_x*v2_y - v1_y*v2_x), v1_x*v2_x + v1_y*v2_y) : -Math.atan2( Math.abs(v1_x*v2_y - v1_y*v2_x), v1_x*v2_x + v1_y*v2_y);
return same_flip ? angle : -angle;
},
Save_Changes: function(data, w)
{},
Load_Changes: function(r)
{},
Write_ToBinary2: function(w)
{},
Read_FromBinary2: function(r)
{}
}; };
\ No newline at end of file
...@@ -57,6 +57,34 @@ function CImageShape(parent) ...@@ -57,6 +57,34 @@ function CImageShape(parent)
CImageShape.prototype = CImageShape.prototype =
{ {
isSimpleObject: function()
{
return true;
},
normalize: function()
{
var new_off_x, new_off_y, new_ext_x, new_ext_y;
var xfrm = this.spPr.xfrm;
if(!isRealObject(this.group))
{
new_off_x = xfrm.offX;
new_off_y = xfrm.offY;
new_ext_x = xfrm.extX;
new_ext_y = xfrm.extY;
}
else
{
var scale_scale_coefficients = this.group.getResultScaleCoefficients();
new_off_x = scale_scale_coefficients.cx*(xfrm.offX - this.group.spPr.xfrm.chOffX);
new_off_y = scale_scale_coefficients.cy*(xfrm.offY - this.group.spPr.xfrm.chOffY);
new_ext_x = scale_scale_coefficients.cx*xfrm.extX;
new_ext_y = scale_scale_coefficients.cy*xfrm.extY;
}
this.setOffset(new_off_x, new_off_y);
this.setExtents(new_ext_x, new_ext_y);
},
sendMouseData: function() sendMouseData: function()
{ {
...@@ -825,49 +853,63 @@ CImageShape.prototype = ...@@ -825,49 +853,63 @@ CImageShape.prototype =
hitToHandles: function(x, y) hitToHandles: function(x, y)
{ {
var px = this.invertTransform.TransformPointX(x, y); var invert_transform = this.getInvertTransform();
var py = this.invertTransform.TransformPointY(x, y); var t_x, t_y;
var distance = this.drawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS); t_x = invert_transform.TransformPointX(x, y);
var dx, dy; t_y = invert_transform.TransformPointY(x, y);
dx = px; var radius = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_CIRCLE_RADIUS);
dy = py;
if(Math.sqrt(dx*dx + dy*dy) < distance)
return 0;
var width = this.extX; var sqr_x = t_x*t_y, sqr_y = t_y*t_y;
var height = this.extY; if(Math.sqrt(sqr_x + sqr_y) < radius)
var hc = width*0.5; return 0;
var vc = height*0.5;
dx = px - hc; var hc = this.extX*0.5;
if(Math.sqrt(dx*dx + dy*dy) < distance) var dist_x = t_x - hc;
sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 1; return 1;
dx = px - width; dist_x = t_x - this.extX;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 2; return 2;
dy = py - vc; var vc = this.extY*0.5;
if(Math.sqrt(dx*dx + dy*dy) < distance) var dist_y = t_y - vc;
sqr_y = dist_y*dist_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 3; return 3;
dy = py - height; dist_y = t_y - this.extY;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_y = dist_y*dist_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 4; return 4;
dx = px - hc; dist_x = t_x - hc;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 5; return 5;
dx = px; dist_x = t_x;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 6; return 6;
dy = py - vc; dist_y = t_y - vc;
if(Math.sqrt(dx*dx + dy*dy) < distance) sqr_y = dist_y*dist_y;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 7; return 7;
var rotate_distance = this.getParentObjects().presentation.DrawingDocument.GetMMPerDot(TRACK_DISTANCE_ROTATE);;
dist_y = t_y + rotate_distance;
sqr_y = dist_y*dist_y;
dist_x = t_x - hc;
sqr_x = dist_x*dist_x;
if(Math.sqrt(sqr_x + sqr_y) < radius)
return 8;
return -1; return -1;
}, },
......
...@@ -3862,7 +3862,7 @@ CPresentation.prototype = ...@@ -3862,7 +3862,7 @@ CPresentation.prototype =
{ {
this.CurPage = PageIndex; this.CurPage = PageIndex;
this.Slides[this.CurPage].onMouseMove(e, X, Y); this.Slides[this.CurPage].onMouseMove(e, X, Y);
this.Update_CursorType( X, Y, PageIndex, e ); //this.Update_CursorType( X, Y, PageIndex, e );
return; return;
return; return;
if ( PageIndex < 0 ) if ( PageIndex < 0 )
......
...@@ -1933,6 +1933,29 @@ CShape.prototype = ...@@ -1933,6 +1933,29 @@ CShape.prototype =
} }
}, },
normalize: function()
{
var new_off_x, new_off_y, new_ext_x, new_ext_y;
var xfrm = this.spPr.xfrm;
if(!isRealObject(this.group))
{
new_off_x = xfrm.offX;
new_off_y = xfrm.offY;
new_ext_x = xfrm.extX;
new_ext_y = xfrm.extY;
}
else
{
var scale_scale_coefficients = this.group.getResultScaleCoefficients();
new_off_x = scale_scale_coefficients.cx*(xfrm.offX - this.group.spPr.xfrm.chOffX);
new_off_y = scale_scale_coefficients.cy*(xfrm.offY - this.group.spPr.xfrm.chOffY);
new_ext_x = scale_scale_coefficients.cx*xfrm.extX;
new_ext_y = scale_scale_coefficients.cy*xfrm.extY;
}
this.setOffset(new_off_x, new_off_y);
this.setExtents(new_ext_x, new_ext_y);
},
setRotate: function(rot) setRotate: function(rot)
{ {
var xfrm = this.spPr.xfrm; var xfrm = this.spPr.xfrm;
...@@ -1988,9 +2011,9 @@ CShape.prototype = ...@@ -1988,9 +2011,9 @@ CShape.prototype =
{ {
checker._s(); checker._s();
checker._m(0, 0); checker._m(0, 0);
checker._l(this.absExtX, 0); checker._l(this.extX, 0);
checker._l(this.absExtX, this.absExtY); checker._l(this.extX, this.extY);
checker._l(0, this.absExtY); checker._l(0, this.extY);
checker._z(); checker._z();
checker._e(); checker._e();
} }
...@@ -2245,6 +2268,11 @@ CShape.prototype = ...@@ -2245,6 +2268,11 @@ CShape.prototype =
editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this; editor.WordControl.m_oLogicDocument.recalcMap[this.Id] = this;
}, },
isSimpleObject: function()
{
return true;
},
draw: function(graphics) draw: function(graphics)
{ {
/*graphics.SetIntegerGrid(false); /*graphics.SetIntegerGrid(false);
......
...@@ -154,11 +154,11 @@ CTextBody.prototype = ...@@ -154,11 +154,11 @@ CTextBody.prototype =
{ {
var Doc = this.content; var Doc = this.content;
if ( true === Doc.Is_SelectionUse() && !Doc.Selection_IsEmpty()) { if ( true === Doc.Is_SelectionUse() && !Doc.Selection_IsEmpty()) {
drawingDocument.UpdateTargetTransform(this.shape.transformText); drawingDocument.UpdateTargetTransform(this.shape.transformText);
drawingDocument.TargetEnd(); drawingDocument.TargetEnd();
drawingDocument.SelectEnabled(true); drawingDocument.SelectEnabled(true);
drawingDocument.SelectClear(); drawingDocument.SelectClear();
Doc.Selection_Draw(); this.content.Selection_Draw_Page(this.shape.parent.num);
drawingDocument.SelectShow(); drawingDocument.SelectShow();
} }
else /*if(this.parent.elementsManipulator.Document.CurPos.Type == docpostype_FlowObjects ) */ else /*if(this.parent.elementsManipulator.Document.CurPos.Type == docpostype_FlowObjects ) */
...@@ -278,6 +278,16 @@ CTextBody.prototype = ...@@ -278,6 +278,16 @@ CTextBody.prototype =
this.content.Recalculate_Page(0, true); this.content.Recalculate_Page(0, true);
}, },
updateCursorType: function(x, y, e)
{
if(this.shape && this.shape.invertTransformText)
{
var tx = this.shape.invertTransformText.TransformPointX(x, y);
var ty = this.shape.invertTransformText.TransformPointY(x, y);
this.content.Update_CursorType(tx, ty, 0);
}
},
Get_StartPage_Absolute: function() Get_StartPage_Absolute: function()
{ {
return isRealObject(this.shape) && isRealObject(this.shape.parent) && isRealNumber(this.shape.parent.num) ? this.shape.parent.num : 0; return isRealObject(this.shape) && isRealObject(this.shape.parent) && isRealNumber(this.shape.parent.num) ? this.shape.parent.num : 0;
......
...@@ -474,7 +474,7 @@ CGraphicObjects.prototype = { ...@@ -474,7 +474,7 @@ CGraphicObjects.prototype = {
{ {
shapes.push(selected_object); shapes.push(selected_object);
} }
else if(typeof selected_object.isImage()) else if(selected_object.isImage())
{ {
images.push(selected_object); images.push(selected_object);
} }
...@@ -584,7 +584,7 @@ CGraphicObjects.prototype = { ...@@ -584,7 +584,7 @@ CGraphicObjects.prototype = {
{ {
var cur_group = groups[i]; var cur_group = groups[i];
var arr_by_types = cur_group.getArraysByTypes(); var arr_by_types = cur_group.getArraysByTypes();
var images = cur_group.images; var images = arr_by_types.images;
for(var i = 0; i < images.length; ++i) for(var i = 0; i < images.length; ++i)
{ {
var _cur_image_prop = images[i].getImageProps(); var _cur_image_prop = images[i].getImageProps();
...@@ -601,7 +601,7 @@ CGraphicObjects.prototype = { ...@@ -601,7 +601,7 @@ CGraphicObjects.prototype = {
} }
} }
var shapes = cur_group.shapes; var shapes = arr_by_types.shapes;
for(var i = 0; i < shapes.length; ++i) for(var i = 0; i < shapes.length; ++i)
{ {
var _current_object = shapes[i]; var _current_object = shapes[i];
......
...@@ -265,6 +265,8 @@ var historyitem_SetShapeOffset = 1; ...@@ -265,6 +265,8 @@ var historyitem_SetShapeOffset = 1;
var historyitem_SetShapeExtents = 2; var historyitem_SetShapeExtents = 2;
var historyitem_SetShapeFlips = 3; var historyitem_SetShapeFlips = 3;
var historyitem_SetShapeParent = 4; var historyitem_SetShapeParent = 4;
var historyitem_SetShapeChildOffset = 5;
var historyitem_SetShapeChildExtents = 6;
......
...@@ -299,7 +299,9 @@ function NullState(drawingObjectsController, drawingObjects) ...@@ -299,7 +299,9 @@ function NullState(drawingObjectsController, drawingObjects)
}; };
this.onMouseMove = function(e, x, y) this.onMouseMove = function(e, x, y)
{}; {
this.drawingObjectsController.Update_CursorType(x, y, e);
};
this.onMouseUp = function(e, x, y) this.onMouseUp = function(e, x, y)
{}; {};
...@@ -1451,7 +1453,7 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject) ...@@ -1451,7 +1453,7 @@ function TextAddState(drawingObjectsController, drawingObjects, textObject)
this.drawSelection = function(drawingDocument) this.drawSelection = function(drawingDocument)
{ {
drawingDocument.DrawTrack(TYPE_TRACK_TEXT, this.textObject.getTransformMatrix(), 0, 0, this.textObject.extX, this.textObject.extY, false/*, selected_objects[i].canRotate()TODO*/); drawingDocument.DrawTrack(TYPE_TRACK_TEXT, this.textObject.getTransformMatrix(), 0, 0, this.textObject.extX, this.textObject.extY, false, this.textObject.canRotate());
this.textObject.drawAdjustments(drawingDocument); this.textObject.drawAdjustments(drawingDocument);
//this.textObject.updateSelectionState(drawingDocument); //this.textObject.updateSelectionState(drawingDocument);
}; };
...@@ -2486,111 +2488,109 @@ function GroupState(drawingObjectsController, drawingObjects, group) ...@@ -2486,111 +2488,109 @@ function GroupState(drawingObjectsController, drawingObjects, group)
for(i = drawing_bases.length - 1; i > -1; --i) for(i = drawing_bases.length - 1; i > -1; --i)
{ {
var cur_drawing_base = drawing_bases[i]; var cur_drawing_base = drawing_bases[i];
if(cur_drawing_base.isGraphicObject()) var cur_drawing = cur_drawing_base;
if(cur_drawing.isSimpleObject())
{ {
var cur_drawing = cur_drawing_base.graphicObject; var hit_in_inner_area = cur_drawing.hitInInnerArea(x, y);
if(cur_drawing.isSimpleObject()) var hit_in_path = cur_drawing.hitInPath(x, y);
var hit_in_text_rect = cur_drawing.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{ {
var hit_in_inner_area = cur_drawing.hitInInnerArea(x, y); this.group.resetSelection(this.drawingObjectsController);
var hit_in_path = cur_drawing.hitInPath(x, y); if(!(e.CtrlKey || e.ShiftKey))
var hit_in_text_rect = cur_drawing.hitInTextRect(x, y); this.drawingObjectsController.resetSelection();
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path) cur_drawing.select(this.drawingObjectsController);
{ for(var j = 0; j < selected_objects.length; ++j)
this.group.resetSelection(this.drawingObjectsController);
if(!(e.CtrlKey || e.ShiftKey))
this.drawingObjectsController.resetSelection();
cur_drawing.select(this.drawingObjectsController);
for(var j = 0; j < selected_objects.length; ++j)
{
this.drawingObjectsController.addPreTrackObject(selected_objects[j].createMoveTrack());
}
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects,x, y, e.ShiftKey, e.ctrl, cur_drawing, false, true));
this.drawingObjects.OnUpdateOverlay();
return;
}
else if(hit_in_text_rect)
{ {
//TODO this.drawingObjectsController.addPreTrackObject(selected_objects[j].createMoveTrack());
} }
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects,x, y, e.ShiftKey, e.ctrl, cur_drawing, false, true));
this.drawingObjects.OnUpdateOverlay();
return;
} }
else else if(hit_in_text_rect)
{ {
if(this.group === cur_drawing) //TODO
}
}
else
{
if(this.group === cur_drawing)
{
var arr_graphic_objects = this.group.getArrGraphicObjects();
for(i = arr_graphic_objects.length - 1; i > -1; --i)
{ {
var arr_graphic_objects = this.group.getArrGraphicObjects(); var cur_drawing = arr_graphic_objects[i];
for(i = arr_graphic_objects.length - 1; i > -1; --i) var hit_in_inner_area = cur_drawing.hitInInnerArea(x, y);
var hit_in_path = cur_drawing.hitInPath(x, y);
var hit_in_text_rect = cur_drawing.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{ {
var cur_drawing = arr_graphic_objects[i]; var is_selected = cur_drawing.selected;
var hit_in_inner_area = cur_drawing.hitInInnerArea(x, y); if(!(e.CtrlKey || e.ShiftKey) && !is_selected)
var hit_in_path = cur_drawing.hitInPath(x, y); this.group.resetSelection();
var hit_in_text_rect = cur_drawing.hitInTextRect(x, y); cur_drawing.select(this.drawingObjectsController);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path) this.drawingObjects.OnUpdateOverlay();
{ for(var j = 0; j < group_selected_objects.length; ++j)
var is_selected = cur_drawing.selected;
if(!(e.CtrlKey || e.ShiftKey) && !is_selected)
this.group.resetSelection();
cur_drawing.select(this.drawingObjectsController);
this.drawingObjects.OnUpdateOverlay();
for(var j = 0; j < group_selected_objects.length; ++j)
{
this.drawingObjectsController.addPreTrackObject(group_selected_objects[j].createMoveInGroupTrack());
}
this.drawingObjectsController.changeCurrentState(new PreMoveInGroupState(this.drawingObjectsController, this.drawingObjects,this.group, x, y, e.ShiftKey, e.ctrl, cur_drawing, is_selected));
this.drawingObjects.OnUpdateOverlay();
return;
}
else if(hit_in_text_rect)
{ {
this.drawingObjectsController.resetSelection(); this.drawingObjectsController.addPreTrackObject(group_selected_objects[j].createMoveInGroupTrack());
this.group.select(this.drawingObjectsController);
cur_drawing.select(this.group);
cur_drawing.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddInGroup(this.drawingObjectsController, this.drawingObjects, this.group, cur_drawing));
if(e.ClickCount < 2)
cur_drawing.updateSelectionState(this.drawingObjects.drawingDocument);
return;
} }
this.drawingObjectsController.changeCurrentState(new PreMoveInGroupState(this.drawingObjectsController, this.drawingObjects,this.group, x, y, e.ShiftKey, e.ctrl, cur_drawing, is_selected));
this.drawingObjects.OnUpdateOverlay();
return;
}
else if(hit_in_text_rect)
{
this.drawingObjectsController.resetSelection();
this.group.select(this.drawingObjectsController);
cur_drawing.select(this.group);
cur_drawing.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddInGroup(this.drawingObjectsController, this.drawingObjects, this.group, cur_drawing));
if(e.ClickCount < 2)
cur_drawing.updateSelectionState(this.drawingObjects.drawingDocument);
return;
} }
} }
else }
else
{
var grouped_objects = cur_drawing.getArrGraphicObjects();
for(var j = grouped_objects.length - 1; j > -1; --j)
{ {
var grouped_objects = cur_drawing.getArrGraphicObjects(); var cur_grouped_object = grouped_objects[j];
for(var j = grouped_objects.length - 1; j > -1; --j) var hit_in_inner_area = cur_grouped_object.hitInInnerArea(x, y);
var hit_in_path = cur_grouped_object.hitInPath(x, y);
var hit_in_text_rect = cur_grouped_object.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{ {
var cur_grouped_object = grouped_objects[j]; this.group.resetSelection(this.drawingObjectsController);
var hit_in_inner_area = cur_grouped_object.hitInInnerArea(x, y); if(!(e.CtrlKey || e.ShiftKey))
var hit_in_path = cur_grouped_object.hitInPath(x, y);
var hit_in_text_rect = cur_grouped_object.hitInTextRect(x, y);
if(hit_in_inner_area && !hit_in_text_rect || hit_in_path)
{
this.group.resetSelection(this.drawingObjectsController);
if(!(e.CtrlKey || e.ShiftKey))
this.drawingObjectsController.resetSelection();
cur_drawing.select(this.drawingObjectsController);
this.drawingObjects.OnUpdateOverlay();
for(var j = 0; j < selected_objects.length; ++j)
{
this.drawingObjectsController.addPreTrackObject(selected_objects[j].createMoveTrack());
}
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects,x, y, e.ShiftKey, e.ctrl, cur_drawing, false, true));
this.drawingObjectsController.OnUpdateOverlay();
return;
}
else if(hit_in_text_rect)
{
this.drawingObjectsController.resetSelection(); this.drawingObjectsController.resetSelection();
cur_drawing.select(this.drawingObjectsController); cur_drawing.select(this.drawingObjectsController);
cur_grouped_object.select(this.group); this.drawingObjects.OnUpdateOverlay();
cur_grouped_object.selectionSetStart(e, x, y); for(var j = 0; j < selected_objects.length; ++j)
this.drawingObjectsController.changeCurrentState(new TextAddInGroup(this.drawingObjectsController, this.drawingObjects, this.group, cur_drawing)); {
if(e.ClickCount < 2) this.drawingObjectsController.addPreTrackObject(selected_objects[j].createMoveTrack());
cur_drawing.updateSelectionState(this.drawingObjects.drawingDocument);
return;
} }
this.drawingObjectsController.changeCurrentState(new PreMoveState(this.drawingObjectsController, this.drawingObjects,x, y, e.ShiftKey, e.ctrl, cur_drawing, false, true));
this.drawingObjectsController.OnUpdateOverlay();
return;
}
else if(hit_in_text_rect)
{
this.drawingObjectsController.resetSelection();
cur_drawing.select(this.drawingObjectsController);
cur_grouped_object.select(this.group);
cur_grouped_object.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddInGroup(this.drawingObjectsController, this.drawingObjects, this.group, cur_drawing));
if(e.ClickCount < 2)
cur_drawing.updateSelectionState(this.drawingObjects.drawingDocument);
return;
} }
} }
} }
} }
} }
this.group.resetSelection(this.drawingObjectsController); this.group.resetSelection(this.drawingObjectsController);
...@@ -2786,7 +2786,7 @@ function TextAddInGroup(drawingObjectsController, drawingObjects, group, textObj ...@@ -2786,7 +2786,7 @@ function TextAddInGroup(drawingObjectsController, drawingObjects, group, textObj
this.onMouseMove = function(e, x, y) this.onMouseMove = function(e, x, y)
{ {
if(e.which > 0 && e.type === "mousemove") if(e.IsLocked)
{ {
this.textObject.selectionSetEnd(e, x, y); this.textObject.selectionSetEnd(e, x, y);
this.textObject.updateSelectionState(this.drawingObjects.drawingDocument); this.textObject.updateSelectionState(this.drawingObjects.drawingDocument);
...@@ -2800,8 +2800,8 @@ function TextAddInGroup(drawingObjectsController, drawingObjects, group, textObj ...@@ -2800,8 +2800,8 @@ function TextAddInGroup(drawingObjectsController, drawingObjects, group, textObj
}; };
this.drawSelection = function(drawingDocument) this.drawSelection = function(drawingDocument)
{ {
drawingDocument.DrawTrack(TYPE_TRACK_GROUP_PASSIVE, this.group.getTransformMatrix(), 0, 0, this.group.extX, this.group.extY, false/*, selected_objects[i].canRotate()TODO*/); drawingDocument.DrawTrack(TYPE_TRACK_GROUP_PASSIVE, this.group.getTransformMatrix(), 0, 0, this.group.extX, this.group.extY, false, this.group.canRotate());
drawingDocument.DrawTrack(TYPE_TRACK_TEXT, this.textObject.getTransformMatrix(), 0, 0, this.textObject.extX, this.textObject.extY, false/*, selected_objects[i].canRotate()TODO*/) drawingDocument.DrawTrack(TYPE_TRACK_TEXT, this.textObject.getTransformMatrix(), 0, 0, this.textObject.extX, this.textObject.extY, false, this.textObject.canRotate());
this.textObject.drawAdjustments(drawingDocument); this.textObject.drawAdjustments(drawingDocument);
}; };
...@@ -3100,51 +3100,24 @@ function MoveInGroupState(drawingObjectsController, drawingObjects, group, start ...@@ -3100,51 +3100,24 @@ function MoveInGroupState(drawingObjectsController, drawingObjects, group, start
{ {
var dx = x - this.startX; var dx = x - this.startX;
var dy = y - this.startY; var dy = y - this.startY;
var check_position = this.drawingObjects.checkGraphicObjectPosition(this.rectX + dx, this.rectY + dy, this.rectW, this.rectH); this.drawingObjectsController.trackMoveObjects(dx, dy);
this.drawingObjectsController.trackMoveObjects(dx + check_position.x, dy + check_position.y);
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
}; };
this.onMouseUp = function(e, x, y) this.onMouseUp = function(e, x, y)
{ {
var worksheet = this.drawingObjects.getWorksheet();
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(this.group.Get_Id());
var track_objects2 = [];
for(var i = 0; i < this.drawingObjectsController.arrTrackObjects.length; ++i)
{
track_objects2.push(this.drawingObjectsController.arrTrackObjects[i]);
}
var drawingObjects = this.drawingObjects; if(this.drawingObjects.presentation.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
var group = this.group;
var callback = function(bLock)
{ {
if(bLock) History.Create_NewPoint();
{ this.drawingObjectsController.trackEnd();
History.Create_NewPoint(); this.group.normalize();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null, this.group.updateCoordinatesAfterInternalResize();
new UndoRedoDataGraphicObjects(group.Get_Id(), new UndoRedoDataGOSingleProp(null, null))); this.drawingObjects.presentation.Recalculate();
for(var i = 0; i < track_objects2.length; ++i) this.drawingObjects.presentation.DrawingDocument.OnRecalculatePage(this.drawingObjects.num, this.drawingObjects);
track_objects2[i].trackEnd(); }
group.normalize();
group.updateCoordinatesAfterInternalResize();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(group.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
group.recalculateTransform();
drawingObjects.showDrawingObjects(true);
}
};
this.drawingObjects.objectLocker.checkObjects(callback);
//this.drawingObjectsController.trackEnd();
// this.group.normalize();
// this.group.updateCoordinatesAfterInternalResize();
//this.group.recalculateTransform();
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
//this.drawingObjects.showDrawingObjects(true);
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new GroupState(this.drawingObjectsController, this.drawingObjects, this.group)); this.drawingObjectsController.changeCurrentState(new GroupState(this.drawingObjectsController, this.drawingObjects, this.group));
...@@ -3342,44 +3315,16 @@ function RotateInGroupState(drawingObjectsController, drawingObjects, group, maj ...@@ -3342,44 +3315,16 @@ function RotateInGroupState(drawingObjectsController, drawingObjects, group, maj
this.onMouseUp = function(e, x, y) this.onMouseUp = function(e, x, y)
{ {
if(this.drawingObjects.presentation.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
var worksheet = this.drawingObjects.getWorksheet();
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(this.group.Get_Id());
var track_objects2 = [];
for(var i = 0; i < this.drawingObjectsController.arrTrackObjects.length; ++i)
{ {
track_objects2.push(this.drawingObjectsController.arrTrackObjects[i]); History.Create_NewPoint();
this.drawingObjectsController.trackEnd();
group.normalize();
group.updateCoordinatesAfterInternalResize();
this.drawingObjects.presentation.Recalculate();
this.drawingObjects.presentation.DrawingDocument.OnRecalculatePage(this.drawingObjects.num, this.drawingObjects);
} }
var drawingObjects = this.drawingObjects;
var group = this.group;
var callback = function(bLock)
{
if(bLock)
{
History.Create_NewPoint();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null,
new UndoRedoDataGraphicObjects(group.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
for(var i = 0; i < track_objects2.length; ++i)
track_objects2[i].trackEnd();
group.normalize();
group.updateCoordinatesAfterInternalResize();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(group.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
group.recalculateTransform();
drawingObjects.showDrawingObjects(true);
}
};
this.drawingObjects.objectLocker.checkObjects(callback);
//this.drawingObjectsController.trackEnd();
// this.group.normalize();
// this.group.updateCoordinatesAfterInternalResize();
//this.group.recalculateTransform();
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
//this.drawingObjects.showDrawingObjects(true);
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new GroupState(this.drawingObjectsController, this.drawingObjects, this.group)); this.drawingObjectsController.changeCurrentState(new GroupState(this.drawingObjectsController, this.drawingObjects, this.group));
...@@ -3470,35 +3415,15 @@ function ResizeInGroupState(drawingObjectsController, drawingObjects, group, maj ...@@ -3470,35 +3415,15 @@ function ResizeInGroupState(drawingObjectsController, drawingObjects, group, maj
this.onMouseUp = function(e, x, y) this.onMouseUp = function(e, x, y)
{ {
var worksheet = this.drawingObjects.getWorksheet(); if(this.drawingObjects.presentation.Document_Is_SelectionLocked(changestype_Drawing_Props) === false)
this.drawingObjects.objectLocker.reset();
this.drawingObjects.objectLocker.addObjectId(this.group.Get_Id());
var track_objects2 = [];
for(var i = 0; i < this.drawingObjectsController.arrTrackObjects.length; ++i)
{ {
track_objects2.push(this.drawingObjectsController.arrTrackObjects[i]); History.Create_NewPoint();
this.drawingObjectsController.trackEnd();
group.normalize();
group.updateCoordinatesAfterInternalResize();
this.drawingObjects.presentation.Recalculate();
this.drawingObjects.presentation.DrawingDocument.OnRecalculatePage(this.drawingObjects.num, this.drawingObjects);
} }
var drawingObjects = this.drawingObjects;
var group = this.group;
var callback = function(bLock)
{
if(bLock)
{
History.Create_NewPoint();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null,
new UndoRedoDataGraphicObjects(group.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
for(var i = 0; i < track_objects2.length; ++i)
track_objects2[i].trackEnd();
group.normalize();
group.updateCoordinatesAfterInternalResize();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(group.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
group.recalculateTransform();
drawingObjects.showDrawingObjects(true);
}
};
this.drawingObjects.objectLocker.checkObjects(callback);
this.drawingObjectsController.clearTrackObjects(); this.drawingObjectsController.clearTrackObjects();
this.drawingObjects.OnUpdateOverlay(); this.drawingObjects.OnUpdateOverlay();
this.drawingObjectsController.changeCurrentState(new GroupState(this.drawingObjectsController, this.drawingObjects, this.group)); this.drawingObjectsController.changeCurrentState(new GroupState(this.drawingObjectsController, this.drawingObjects, this.group));
...@@ -4285,7 +4210,7 @@ function DrawDefaultSelection(drawingObjectsController, drawingDocument) ...@@ -4285,7 +4210,7 @@ function DrawDefaultSelection(drawingObjectsController, drawingDocument)
var selected_objects = drawingObjectsController.selectedObjects; var selected_objects = drawingObjectsController.selectedObjects;
for(var i = 0; i < selected_objects.length; ++i) for(var i = 0; i < selected_objects.length; ++i)
{ {
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, selected_objects[i].getTransformMatrix(), 0, 0, selected_objects[i].extX, selected_objects[i].extY, false/*, selected_objects[i].canRotate()TODO*/); drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, selected_objects[i].getTransformMatrix(), 0, 0, selected_objects[i].extX, selected_objects[i].extY, false, selected_objects[i].canRotate());
} }
if(selected_objects.length === 1) if(selected_objects.length === 1)
{ {
...@@ -4295,11 +4220,11 @@ function DrawDefaultSelection(drawingObjectsController, drawingDocument) ...@@ -4295,11 +4220,11 @@ function DrawDefaultSelection(drawingObjectsController, drawingDocument)
function DrawGroupSelection(group, drawingDocument) function DrawGroupSelection(group, drawingDocument)
{ {
drawingDocument.DrawTrack(TYPE_TRACK_GROUP_PASSIVE, group.getTransformMatrix(), 0, 0, group.extX, group.extY, false/*, selected_objects[i].canRotate()TODO*/); drawingDocument.DrawTrack(TYPE_TRACK_GROUP_PASSIVE, group.getTransformMatrix(), 0, 0, group.extX, group.extY, false, group.canRotate());
var group_selected_objects = group.selectedObjects; var group_selected_objects = group.selectedObjects;
for(var i = 0; i < group_selected_objects.length; ++i) for(var i = 0; i < group_selected_objects.length; ++i)
{ {
drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, group_selected_objects[i].getTransformMatrix(), 0, 0, group_selected_objects[i].extX, group_selected_objects[i].extY, false/*, selected_objects[i].canRotate()TODO*/) drawingDocument.DrawTrack(TYPE_TRACK_SHAPE, group_selected_objects[i].getTransformMatrix(), 0, 0, group_selected_objects[i].extX, group_selected_objects[i].extY, false, group_selected_objects[i].canRotate())
} }
if(group_selected_objects.length === 1) if(group_selected_objects.length === 1)
{ {
......
...@@ -93,16 +93,14 @@ function MoveShapeImageTrackInGroup(originalObject) ...@@ -93,16 +93,14 @@ function MoveShapeImageTrackInGroup(originalObject)
} }
global_MatrixTransformer.RotateRadAppend(t, -this.originalObject.rot); global_MatrixTransformer.RotateRadAppend(t, -this.originalObject.rot);
global_MatrixTransformer.TranslateAppend(t, this.x + this.originalObject.extX*0.5, this.y + this.originalObject.extY*0.5); global_MatrixTransformer.TranslateAppend(t, this.x + this.originalObject.extX*0.5, this.y + this.originalObject.extY*0.5);
global_MatrixTransformer.MultiplyAppend(t, this.originalObject.group.getTransform()); global_MatrixTransformer.MultiplyAppend(t, this.originalObject.group.getTransformMatrix());
}; };
this.trackEnd = function() this.trackEnd = function()
{ {
var scale_scale_coefficients = this.originalObject.group.getResultScaleCoefficients(); var scale_scale_coefficients = this.originalObject.group.getResultScaleCoefficients();
var xfrm = this.originalObject.group.spPr.xfrm; var xfrm = this.originalObject.group.spPr.xfrm;
this.originalObject.setPosition(this.x/scale_scale_coefficients.cx + xfrm.chOffX, this.y/scale_scale_coefficients.cy + xfrm.chOffY); this.originalObject.setOffset(this.x/scale_scale_coefficients.cx + xfrm.chOffX, this.y/scale_scale_coefficients.cy + xfrm.chOffY);
this.originalObject.recalculateTransform();
this.originalObject.calculateTransformTextMatrix();
} }
} }
...@@ -120,7 +118,7 @@ function MoveGroupTrack(originalObject) ...@@ -120,7 +118,7 @@ function MoveGroupTrack(originalObject)
var group_invert_transform = originalObject.getInvertTransform(); var group_invert_transform = originalObject.getInvertTransform();
for(var i = 0; i < arr_graphic_objects.length; ++i) for(var i = 0; i < arr_graphic_objects.length; ++i)
{ {
var gr_obj_transform_copy = arr_graphic_objects[i].getTransform().CreateDublicate(); var gr_obj_transform_copy = arr_graphic_objects[i].getTransformMatrix().CreateDublicate();
global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform); global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform);
this.arrTransforms2[i] = gr_obj_transform_copy; this.arrTransforms2[i] = gr_obj_transform_copy;
this.overlayObjects[i] = new OverlayObject(arr_graphic_objects[i].spPr.geometry, arr_graphic_objects[i].extX, arr_graphic_objects[i].extY, this.overlayObjects[i] = new OverlayObject(arr_graphic_objects[i].spPr.geometry, arr_graphic_objects[i].extX, arr_graphic_objects[i].extY,
...@@ -168,13 +166,7 @@ function MoveGroupTrack(originalObject) ...@@ -168,13 +166,7 @@ function MoveGroupTrack(originalObject)
this.trackEnd = function() this.trackEnd = function()
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null, this.originalObject.setXfrm(this.x, this.y, null, null, null, null, null);
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.originalObject.setPosition(this.x, this.y);
this.originalObject.recalculate();
this.originalObject.updateDrawingBaseCoordinates();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
}; };
} }
...@@ -230,7 +222,7 @@ function MoveTitleInChart(originalObject) ...@@ -230,7 +222,7 @@ function MoveTitleInChart(originalObject)
t.Reset(); t.Reset();
global_MatrixTransformer.TranslateAppend(t, -this.originalObject.extX*0.5, -this.originalObject.extY*0.5); global_MatrixTransformer.TranslateAppend(t, -this.originalObject.extX*0.5, -this.originalObject.extY*0.5);
global_MatrixTransformer.TranslateAppend(t, this.x + this.originalObject.extX*0.5, this.y + this.originalObject.extY*0.5); global_MatrixTransformer.TranslateAppend(t, this.x + this.originalObject.extX*0.5, this.y + this.originalObject.extY*0.5);
global_MatrixTransformer.MultiplyAppend(t, this.originalObject.chartGroup.getTransform()); global_MatrixTransformer.MultiplyAppend(t, this.originalObject.chartGroup.getTransformMatrix());
}; };
this.trackEnd = function() this.trackEnd = function()
......
...@@ -972,7 +972,7 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection) ...@@ -972,7 +972,7 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection)
global_MatrixTransformer.TranslateAppend(_transform, this.resizedPosX, this.resizedPosY); global_MatrixTransformer.TranslateAppend(_transform, this.resizedPosX, this.resizedPosY);
global_MatrixTransformer.TranslateAppend(_transform, _horizontal_center, _vertical_center); global_MatrixTransformer.TranslateAppend(_transform, _horizontal_center, _vertical_center);
global_MatrixTransformer.MultiplyAppend(_transform, this.originalObject.group.getTransform()); global_MatrixTransformer.MultiplyAppend(_transform, this.originalObject.group.getTransformMatrix());
}; };
this.resizeRelativeCenter = function(kd1, kd2, ShiftKey) this.resizeRelativeCenter = function(kd1, kd2, ShiftKey)
...@@ -1071,7 +1071,7 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection) ...@@ -1071,7 +1071,7 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection)
global_MatrixTransformer.TranslateAppend(_transform, this.resizedPosX, this.resizedPosY); global_MatrixTransformer.TranslateAppend(_transform, this.resizedPosX, this.resizedPosY);
global_MatrixTransformer.TranslateAppend(_transform, _horizontal_center, _vertical_center); global_MatrixTransformer.TranslateAppend(_transform, _horizontal_center, _vertical_center);
global_MatrixTransformer.MultiplyAppend(_transform, this.originalObject.group.getTransform()); global_MatrixTransformer.MultiplyAppend(_transform, this.originalObject.group.getTransformMatrix());
}; };
this.draw = function(overlay) this.draw = function(overlay)
...@@ -1118,12 +1118,9 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection) ...@@ -1118,12 +1118,9 @@ function ResizeTrackShapeImageInGroup(originalObject, cardDirection)
{ {
var scale_scale_coefficients = this.originalObject.group.getResultScaleCoefficients(); var scale_scale_coefficients = this.originalObject.group.getResultScaleCoefficients();
var xfrm = this.originalObject.group.spPr.xfrm; var xfrm = this.originalObject.group.spPr.xfrm;
this.originalObject.setPosition(this.resizedPosX/scale_scale_coefficients.cx + xfrm.chOffX, this.resizedPosY/scale_scale_coefficients.cy + xfrm.chOffY); this.originalObject.setOffset(this.resizedPosX/scale_scale_coefficients.cx + xfrm.chOffX, this.resizedPosY/scale_scale_coefficients.cy + xfrm.chOffY);
this.originalObject.setExtents(this.resizedExtX/scale_scale_coefficients.cx, this.resizedExtY/scale_scale_coefficients.cy); this.originalObject.setExtents(this.resizedExtX/scale_scale_coefficients.cx, this.resizedExtY/scale_scale_coefficients.cy);
this.originalObject.setFlips(this.resizedflipH, this.resizedflipV); this.originalObject.setFlips(this.resizedflipH, this.resizedflipV);
this.originalObject.recalculateTransform();
this.originalObject.calculateContent();
this.originalObject.calculateTransformTextMatrix();
}; };
} }
...@@ -1745,9 +1742,7 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack) ...@@ -1745,9 +1742,7 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
this.trackEnd = function() this.trackEnd = function()
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null, this.original.setOffset(this.x, this.y);
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.original.setPosition(this.x, this.y);
this.original.setExtents(this.extX, this.extY); this.original.setExtents(this.extX, this.extY);
this.original.setChildExtents(this.extX, this.extY); this.original.setChildExtents(this.extX, this.extY);
this.original.setFlips(this.flipH, this.flipV); this.original.setFlips(this.flipH, this.flipV);
...@@ -1755,11 +1750,7 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack) ...@@ -1755,11 +1750,7 @@ function ResizeTrackGroup(originalObject, cardDirection, parentTrack)
{ {
this.childs[i].trackEnd(); this.childs[i].trackEnd();
} }
if(this.parentTrack == null)
this.original.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
}; };
...@@ -1842,7 +1833,7 @@ function ShapeForResizeInGroup(originalObject, parentTrack) ...@@ -1842,7 +1833,7 @@ function ShapeForResizeInGroup(originalObject, parentTrack)
this.trackEnd = function() this.trackEnd = function()
{ {
this.originalObject.setPosition(this.x, this.y); this.originalObject.setOffset(this.x, this.y);
this.originalObject.setExtents(this.extX, this.extY); this.originalObject.setExtents(this.extX, this.extY);
if(this.originalObject.spPr.geometry !== null) if(this.originalObject.spPr.geometry !== null)
this.originalObject.spPr.geometry.Recalculate(this.extX, this.extY); this.originalObject.spPr.geometry.Recalculate(this.extX, this.extY);
...@@ -2413,34 +2404,12 @@ function ResizeTrackChart(originalObject, cardDirection) ...@@ -2413,34 +2404,12 @@ function ResizeTrackChart(originalObject, cardDirection)
this.trackEnd = function() this.trackEnd = function()
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.originalObject.Id, new UndoRedoDataShapeRecalc()), null);
this.originalObject.x = this.resizedPosX; this.originalObject.x = this.resizedPosX;
this.originalObject.y = this.resizedPosY; this.originalObject.y = this.resizedPosY;
this.originalObject.extX = this.resizedExtX; this.originalObject.extX = this.resizedExtX;
this.originalObject.extY = this.resizedExtY; this.originalObject.extY = this.resizedExtY;
this.originalObject.setPosition(this.resizedPosX, this.resizedPosY); this.originalObject.setOffset(this.resizedPosX, this.resizedPosY);
this.originalObject.setExtents(this.resizedExtX, this.resizedExtY); this.originalObject.setExtents(this.resizedExtX, this.resizedExtY);
this.originalObject.updateDrawingBaseCoordinates();
// this.originalObject.setFlips(this.resizedflipH, this.resizedflipV);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.originalObject.Id, new UndoRedoDataShapeRecalc()), null);
this.originalObject.recalculate();
/*this.originalObject.recalculateTransform();
this.originalObject.calculateContent();
this.originalObject.calculateTransformTextMatrix();
*/ var bounds_rect = this.originalObject.getRectBounds();
var check_position = this.originalObject.drawingObjects.checkGraphicObjectPosition(bounds_rect.minX, bounds_rect.minY, bounds_rect.maxX - bounds_rect.minX, bounds_rect.maxY - bounds_rect.minY);
if(!check_position.result)
{
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformUndo, null, null, new UndoRedoDataGraphicObjects(this.originalObject.Id, new UndoRedoDataShapeRecalc()), null);
this.originalObject.setPosition(this.resizedPosX + check_position.x, this.resizedPosY + check_position.y);
this.originalObject.x = this.resizedPosX+ check_position.x;
this.originalObject.y = this.resizedPosY+ check_position.y;
this.originalObject.updateDrawingBaseCoordinates();
this.originalObject.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateTransformRedo, null, null, new UndoRedoDataGraphicObjects(this.originalObject.Id, new UndoRedoDataShapeRecalc()), null);
}
}; };
} }
...@@ -205,15 +205,12 @@ function RotateTrackShapeImageInGroup(originalObject) ...@@ -205,15 +205,12 @@ function RotateTrackShapeImageInGroup(originalObject)
global_MatrixTransformer.ScaleAppend(this.transform, 1, -1); global_MatrixTransformer.ScaleAppend(this.transform, 1, -1);
global_MatrixTransformer.RotateRadAppend(this.transform, -this.angle); global_MatrixTransformer.RotateRadAppend(this.transform, -this.angle);
global_MatrixTransformer.TranslateAppend(this.transform, this.originalObject.x + hc, this.originalObject.y + vc); global_MatrixTransformer.TranslateAppend(this.transform, this.originalObject.x + hc, this.originalObject.y + vc);
global_MatrixTransformer.MultiplyAppend(this.transform, this.originalObject.group.getTransform()); global_MatrixTransformer.MultiplyAppend(this.transform, this.originalObject.group.getTransformMatrix());
}; };
this.trackEnd = function() this.trackEnd = function()
{ {
this.originalObject.setRotate(this.angle); this.originalObject.setRotate(this.angle);
this.originalObject.recalculateTransform();
this.originalObject.calculateContent();
this.originalObject.calculateTransformTextMatrix();
} }
} }
...@@ -232,7 +229,7 @@ function RotateTrackGroup(originalObject) ...@@ -232,7 +229,7 @@ function RotateTrackGroup(originalObject)
var group_invert_transform = originalObject.getInvertTransform(); var group_invert_transform = originalObject.getInvertTransform();
for(var i = 0; i < arr_graphic_objects.length; ++i) for(var i = 0; i < arr_graphic_objects.length; ++i)
{ {
var gr_obj_transform_copy = arr_graphic_objects[i].getTransform().CreateDublicate(); var gr_obj_transform_copy = arr_graphic_objects[i].getTransformMatrix().CreateDublicate();
global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform); global_MatrixTransformer.MultiplyAppend(gr_obj_transform_copy, group_invert_transform);
this.arrTransforms2[i] = gr_obj_transform_copy; this.arrTransforms2[i] = gr_obj_transform_copy;
this.overlayObjects[i] = new OverlayObject(arr_graphic_objects[i].spPr.geometry, arr_graphic_objects[i].extX, arr_graphic_objects[i].extY, this.overlayObjects[i] = new OverlayObject(arr_graphic_objects[i].spPr.geometry, arr_graphic_objects[i].extX, arr_graphic_objects[i].extY,
...@@ -295,11 +292,6 @@ function RotateTrackGroup(originalObject) ...@@ -295,11 +292,6 @@ function RotateTrackGroup(originalObject)
this.trackEnd = function() this.trackEnd = function()
{ {
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateUndo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
this.originalObject.setRotate(this.angle); this.originalObject.setRotate(this.angle);
this.originalObject.recalculate();
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateRedo, null, null,
new UndoRedoDataGraphicObjects(this.originalObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
} }
} }
\ No newline at end of file
...@@ -73,6 +73,10 @@ ...@@ -73,6 +73,10 @@
<script type="text/javascript" src="Editor/Format/Presentation.js"></script> <script type="text/javascript" src="Editor/Format/Presentation.js"></script>
<script type="text/javascript" src="Editor/Format/Shape.js"></script> <script type="text/javascript" src="Editor/Format/Shape.js"></script>
<script type="text/javascript" src="Editor/Format/Image.js"></script> <script type="text/javascript" src="Editor/Format/Image.js"></script>
<script type="text/javascript" src="Editor/Format/Chart.js"></script>
<script type="text/javascript" src="Editor/Format/ChartLayout.js"></script>
<script type="text/javascript" src="Editor/Format/ChartLegend.js"></script>
<script type="text/javascript" src="Editor/Format/ChartTitle.js"></script>
<script type="text/javascript" src="Editor/Format/GroupShape.js"></script> <script type="text/javascript" src="Editor/Format/GroupShape.js"></script>
<script type="text/javascript" src="Editor/Format/Slide.js"></script> <script type="text/javascript" src="Editor/Format/Slide.js"></script>
<script type="text/javascript" src="Editor/Format/SlideMaster.js"></script> <script type="text/javascript" src="Editor/Format/SlideMaster.js"></script>
......
...@@ -3626,11 +3626,11 @@ asc_docs_api.prototype.sync_slidePropCallback = function(slide) ...@@ -3626,11 +3626,11 @@ asc_docs_api.prototype.sync_slidePropCallback = function(slide)
} }
obj.Timing = slide.timing; obj.Timing = slide.timing;
obj.lockDelete = !(slide.deleteLock.Type === locktype_Mine || slide.deleteLock.Type === locktype_None); obj.lockDelete = !(slide.deleteLock.Lock.Type === locktype_Mine || slide.deleteLock.Lock.Type === locktype_None);
obj.lockLayout = !(slide.layoutLock.Type === locktype_Mine || slide.layoutLock.Type === locktype_None); obj.lockLayout = !(slide.layoutLock.Lock.Type === locktype_Mine || slide.layoutLock.Lock.Type === locktype_None);
obj.lockTiming = !(slide.timingLock.Type === locktype_Mine || slide.timingLock.Type === locktype_None); obj.lockTiming = !(slide.timingLock.Lock.Type === locktype_Mine || slide.timingLock.Lock.Type === locktype_None);
obj.lockTranzition = !(slide.transitionLock.Type === locktype_Mine || slide.transitionLock.Type === locktype_None); obj.lockTranzition = !(slide.transitionLock.Lock.Type === locktype_Mine || slide.transitionLock.Lock.Type === locktype_None);
obj.lockBackground = !(slide.backgroundLock.Type === locktype_Mine || slide.backgroundLock.Type === locktype_None); obj.lockBackground = !(slide.backgroundLock.Lock.Type === locktype_Mine || slide.backgroundLock.Lock.Type === locktype_None);
obj.lockRemove = obj.lockDelete || obj.lockRemove = obj.lockDelete ||
obj.lockLayout || obj.lockLayout ||
obj.lockTiming || obj.lockTiming ||
......
...@@ -205,6 +205,15 @@ ...@@ -205,6 +205,15 @@
<script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/Editor/States.js"></script> <script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/Editor/States.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/Editor/Format/Chart.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/Editor/Format/ChartLayout.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/Editor/Format/ChartLegend.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/PowerPoint/Editor/Format/ChartTitle.js"></script>
......
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