Commit dec0c785 authored by SergeyLuzyanin's avatar SergeyLuzyanin

fix Bug 35062

parent 249a7668
...@@ -569,10 +569,28 @@ CImageShape.prototype.Refresh_RecalcData = function(data) ...@@ -569,10 +569,28 @@ CImageShape.prototype.Refresh_RecalcData = function(data)
CImageShape.prototype.recalculateGeometry = function() CImageShape.prototype.recalculateGeometry = function()
{ {
if(isRealObject(this.spPr.geometry)) this.calcGeometry = null;
if(isRealObject(this.spPr.geometry)){
this.calcGeometry = this.spPr.geometry;
}
else{
var hierarchy = this.getHierarchy();
for(var i = 0; i < hierarchy.length; ++i){
if(hierarchy[i] && hierarchy[i].spPr && hierarchy[i].spPr.geometry){
var _g = hierarchy[i].spPr.geometry;
this.calcGeometry = AscFormat.ExecuteNoHistory(function(){
var _r = _g.createDuplicate();
_r.setParent(this);
return _r;
}, this, []);
break;
}
}
}
if(isRealObject(this.calcGeometry))
{ {
var transform = this.getTransform(); var transform = this.getTransform();
this.spPr.geometry.Recalculate(transform.extX, transform.extY); this.calcGeometry.Recalculate(transform.extX, transform.extY);
} }
}; };
...@@ -614,8 +632,8 @@ CImageShape.prototype.draw = function(graphics, transform) ...@@ -614,8 +632,8 @@ CImageShape.prototype.draw = function(graphics, transform)
var shape_drawer = new AscCommon.CShapeDrawer(); var shape_drawer = new AscCommon.CShapeDrawer();
if(this.getObjectType() !== AscDFH.historyitem_type_OleObject && (this.pen || this.brush)) if(this.getObjectType() !== AscDFH.historyitem_type_OleObject && (this.pen || this.brush))
{ {
shape_drawer.fromShape2(this, graphics, this.spPr.geometry); shape_drawer.fromShape2(this, graphics, this.calcGeometry);
shape_drawer.draw(this.spPr.geometry); shape_drawer.draw(this.calcGeometry);
shape_drawer.Clear(); shape_drawer.Clear();
} }
var oldBrush = this.brush; var oldBrush = this.brush;
...@@ -625,8 +643,8 @@ CImageShape.prototype.draw = function(graphics, transform) ...@@ -625,8 +643,8 @@ CImageShape.prototype.draw = function(graphics, transform)
this.brush.fill = this.blipFill; this.brush.fill = this.blipFill;
this.pen = null; this.pen = null;
shape_drawer.fromShape2(this, graphics, this.spPr.geometry); shape_drawer.fromShape2(this, graphics, this.calcGeometry);
shape_drawer.draw(this.spPr.geometry); shape_drawer.draw(this.calcGeometry);
this.brush = oldBrush; this.brush = oldBrush;
this.pen = oldPen; this.pen = oldPen;
...@@ -683,12 +701,12 @@ CImageShape.prototype.deselect = function(drawingObjectsController) ...@@ -683,12 +701,12 @@ CImageShape.prototype.deselect = function(drawingObjectsController)
CImageShape.prototype.drawAdjustments = function(drawingDocument) CImageShape.prototype.drawAdjustments = function(drawingDocument)
{ {
if (this.calcGeometry) {
this.calcGeometry.drawAdjustments(drawingDocument, this.transform, false);
}
}; };
CImageShape.prototype.hitToAdjustment = function() CImageShape.prototype.hitToAdjustment = CShape.prototype.hitToAdjustment;
{
return {hit:false};
};
CImageShape.prototype.getPlaceholderType = function() CImageShape.prototype.getPlaceholderType = function()
{ {
......
...@@ -4871,12 +4871,13 @@ CShape.prototype.hitToAdjustment = function (x, y) { ...@@ -4871,12 +4871,13 @@ CShape.prototype.hitToAdjustment = function (x, y) {
var t_x, t_y, ret; var t_x, t_y, ret;
t_x = invert_transform.TransformPointX(x, y); t_x = invert_transform.TransformPointX(x, y);
t_y = invert_transform.TransformPointY(x, y); t_y = invert_transform.TransformPointY(x, y);
if (this.spPr && isRealObject(this.spPr.geometry)) var _calcGeoem = this.calcGeometry || (this.spPr && this.spPr.geometry);
if (_calcGeoem)
{ {
invert_transform = this.getInvertTransform(); invert_transform = this.getInvertTransform();
t_x = invert_transform.TransformPointX(x, y); t_x = invert_transform.TransformPointX(x, y);
t_y = invert_transform.TransformPointY(x, y); t_y = invert_transform.TransformPointY(x, y);
ret = this.spPr.geometry.hitToAdj(t_x, t_y, this.convertPixToMM(global_mouseEvent.KoefPixToMM * AscCommon.TRACK_CIRCLE_RADIUS)); ret = _calcGeoem.hitToAdj(t_x, t_y, this.convertPixToMM(global_mouseEvent.KoefPixToMM * AscCommon.TRACK_CIRCLE_RADIUS));
if(ret.hit) if(ret.hit)
{ {
ret.warp = false; ret.warp = false;
......
...@@ -42,7 +42,12 @@ function XYAdjustmentTrack(originalShape, adjIndex, bTextWarp) ...@@ -42,7 +42,12 @@ function XYAdjustmentTrack(originalShape, adjIndex, bTextWarp)
var oPen, oBrush; var oPen, oBrush;
if(bTextWarp !== true) if(bTextWarp !== true)
{ {
this.geometry = originalShape.spPr.geometry.createDuplicate(); if(originalShape.spPr && originalShape.spPr.geometry){
this.geometry = originalShape.spPr.geometry.createDuplicate();
}
else if(originalShape.calcGeometry){
this.geometry = originalShape.calcGeometry.createDuplicate();
}
this.shapeWidth = originalShape.extX; this.shapeWidth = originalShape.extX;
this.shapeHeight = originalShape.extY; this.shapeHeight = originalShape.extY;
this.transform = originalShape.transform.CreateDublicate(); this.transform = originalShape.transform.CreateDublicate();
...@@ -251,6 +256,9 @@ XYAdjustmentTrack.prototype.trackEnd = function() ...@@ -251,6 +256,9 @@ XYAdjustmentTrack.prototype.trackEnd = function()
var oGeometryToSet; var oGeometryToSet;
if(!this.bTextWarp) if(!this.bTextWarp)
{ {
if(!this.originalShape.spPr.geometry){
this.originalShape.spPr.setGeometry(this.geometry.createDuplicate());
}
oGeometryToSet = this.originalShape.spPr.geometry; oGeometryToSet = this.originalShape.spPr.geometry;
if(this.xFlag) if(this.xFlag)
{ {
...@@ -303,7 +311,12 @@ function PolarAdjustmentTrack(originalShape, adjIndex, bTextWarp) ...@@ -303,7 +311,12 @@ function PolarAdjustmentTrack(originalShape, adjIndex, bTextWarp)
var oPen, oBrush; var oPen, oBrush;
if(bTextWarp !== true) if(bTextWarp !== true)
{ {
this.geometry = originalShape.spPr.geometry.createDuplicate(); if(originalShape.spPr && originalShape.spPr.geometry){
this.geometry = originalShape.spPr.geometry.createDuplicate();
}
else if(originalShape.calcGeometry){
this.geometry = originalShape.calcGeometry.createDuplicate();
}
this.shapeWidth = originalShape.extX; this.shapeWidth = originalShape.extX;
this.shapeHeight = originalShape.extY; this.shapeHeight = originalShape.extY;
this.transform = originalShape.transform; this.transform = originalShape.transform;
...@@ -449,6 +462,9 @@ function PolarAdjustmentTrack(originalShape, adjIndex, bTextWarp) ...@@ -449,6 +462,9 @@ function PolarAdjustmentTrack(originalShape, adjIndex, bTextWarp)
var oGeometryToSet; var oGeometryToSet;
if(!this.bTextWarp) if(!this.bTextWarp)
{ {
if(!this.originalShape.spPr.geometry){
this.originalShape.spPr.setGeometry(this.geometry.createDuplicate());
}
oGeometryToSet = this.originalShape.spPr.geometry; oGeometryToSet = this.originalShape.spPr.geometry;
if(this.radiusFlag) if(this.radiusFlag)
{ {
......
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