Commit f737d13a authored by Sergey Luzyanin's avatar Sergey Luzyanin

Копируем размеры в процентах

parent 0808e3c9
......@@ -2207,12 +2207,12 @@ DrawingObjectsController.prototype =
}
var aGroups = [];
if(isRealNumber(props.Width) && isRealNumber(props.Height))
if(isRealNumber(props.Width) || isRealNumber(props.Height))
{
for(i = 0; i < objects_by_type.shapes.length; ++i)
{
CheckSpPrXfrm(objects_by_type.shapes[i]);
if(!props.SizeRelH)
if(!props.SizeRelH && isRealNumber(props.Width))
{
objects_by_type.shapes[i].spPr.xfrm.setExtX(props.Width);
if(objects_by_type.shapes[i].parent instanceof ParaDrawing)
......@@ -2220,7 +2220,7 @@ DrawingObjectsController.prototype =
objects_by_type.shapes[i].parent.SetSizeRelH({RelativeFrom: c_oAscSizeRelFromH.sizerelfromhPage, Percent: 0})
}
}
if(!props.SizeRelV)
if(!props.SizeRelV && isRealNumber(props.Height))
{
objects_by_type.shapes[i].spPr.xfrm.setExtY(props.Height);
if(objects_by_type.shapes[i].parent instanceof ParaDrawing)
......@@ -2247,7 +2247,7 @@ DrawingObjectsController.prototype =
}
objects_by_type.shapes[i].checkDrawingBaseCoords();
}
if(!props.SizeRelH && !props.SizeRelV)
if(!props.SizeRelH && !props.SizeRelV && isRealNumber(props.Width) && isRealNumber(props.Height))
{
for(i = 0; i < objects_by_type.images.length; ++i)
{
......
......@@ -536,7 +536,7 @@ CGraphicObjects.prototype =
{
this.selectedObjects[i].parent.Set_Props(oProps);
}
if(isRealNumber(oProps.Width) && isRealNumber(oProps.Height))
if(isRealNumber(oProps.Width) || isRealNumber(oProps.Height))
{
oApplyProps = oProps;
}
......@@ -545,7 +545,7 @@ CGraphicObjects.prototype =
oApplyProps = oProps.ShapeProperties ? oProps.ShapeProperties : oProps;
}
this.applyDrawingProps(oApplyProps);
if(isRealNumber(oApplyProps.Width) && isRealNumber(oApplyProps.Height))
if(isRealNumber(oApplyProps.Width) || isRealNumber(oApplyProps.Height))
{
/*в случае если в насторойках ParaDrawing стоит UseAlign - пересчитываем drawing, т. к. ширина и высото ParaDrawing рассчитывается по bounds*/
var aSelectedObjects = this.selectedObjects;
......
......@@ -4754,6 +4754,14 @@ ParaDrawing.prototype =
}
c.Set_BehindDoc(this.behindDoc);
c.Set_RelativeHeight(this.RelativeHeight);
if(this.SizeRelH)
{
c.SetSizeRelH({RelativeFrom: this.SizeRelH.RelativeFrom, Percent: this.SizeRelH.Percent});
}
if(this.SizeRelV)
{
c.SetSizeRelV({RelativeFrom: this.SizeRelV.RelativeFrom, Percent: this.SizeRelV.Percent});
}
if(isRealNumber(this.Extent.W) && isRealNumber(this.Extent.H))
{
c.setExtent(this.Extent.W, this.Extent.H);
......
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