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

Добавляем ватермарк наверх. Поправлен баг с процентами в группе

parent 2831d5b7
"use strict"; "use strict";
function CGroupShape() function CGroupShape()
{ {
...@@ -458,13 +458,98 @@ CGroupShape.prototype = ...@@ -458,13 +458,98 @@ CGroupShape.prototype =
var cx, cy; var cx, cy;
if(this.spPr.xfrm.isNotNullForGroup()) if(this.spPr.xfrm.isNotNullForGroup())
{ {
var dExtX = this.spPr.xfrm.extX, dExtY = this.spPr.xfrm.extY;
var oParaDrawing = getParaDrawing(this);
if(oParaDrawing)
{
if(oParaDrawing.SizeRelH || oParaDrawing.SizeRelV)
{
this.m_oSectPr = null;
var oParentParagraph = oParaDrawing.Get_ParentParagraph();
if(oParentParagraph)
{
var oSectPr = oParentParagraph.Get_SectPr();
if(oSectPr)
{
if(oParaDrawing.SizeRelH && oParaDrawing.SizeRelH.Percent > 0)
{
switch(oParaDrawing.SizeRelH.RelativeFrom)
{
case c_oAscSizeRelFromH.sizerelfromhMargin:
{
dExtX = oSectPr.Get_PageWidth() - oSectPr.Get_PageMargin_Left() - oSectPr.Get_PageMargin_Right();
break;
}
case c_oAscSizeRelFromH.sizerelfromhPage:
{
dExtX = oSectPr.Get_PageWidth();
break;
}
case c_oAscSizeRelFromH.sizerelfromhLeftMargin:
{
dExtX = oSectPr.Get_PageMargin_Left();
break;
}
case c_oAscSizeRelFromH.sizerelfromhRightMargin:
{
dExtX = oSectPr.Get_PageMargin_Right();
break;
}
default:
{
dExtX = oSectPr.Get_PageMargin_Left();
break;
}
}
dExtX *= oParaDrawing.SizeRelH.Percent;
}
if(oParaDrawing.SizeRelV && oParaDrawing.SizeRelV.Percent > 0)
{
switch(oParaDrawing.SizeRelV.RelativeFrom)
{
case c_oAscSizeRelFromV.sizerelfromvMargin:
{
dExtY = oSectPr.Get_PageHeight() - oSectPr.Get_PageMargin_Top() - oSectPr.Get_PageMargin_Bottom();
break;
}
case c_oAscSizeRelFromV.sizerelfromvPage:
{
dExtY = oSectPr.Get_PageHeight();
break;
}
case c_oAscSizeRelFromV.sizerelfromvTopMargin:
{
dExtY = oSectPr.Get_PageMargin_Top();
break;
}
case c_oAscSizeRelFromV.sizerelfromvBottomMargin:
{
dExtY = oSectPr.Get_PageMargin_Bottom();
break;
}
default:
{
dExtY = oSectPr.Get_PageMargin_Top();
break;
}
}
dExtY *= oParaDrawing.SizeRelV.Percent;
}
}
}
}
}
if(this.spPr.xfrm.chExtX > 0) if(this.spPr.xfrm.chExtX > 0)
cx = this.spPr.xfrm.extX/this.spPr.xfrm.chExtX; cx = dExtX/this.spPr.xfrm.chExtX;
else else
cx = 1; cx = 1;
if(this.spPr.xfrm.chExtY > 0) if(this.spPr.xfrm.chExtY > 0)
cy = this.spPr.xfrm.extY/this.spPr.xfrm.chExtY; cy = dExtY/this.spPr.xfrm.chExtY;
else else
cy = 1; cy = 1;
} }
......
...@@ -301,7 +301,6 @@ CGraphicObjects.prototype = ...@@ -301,7 +301,6 @@ CGraphicObjects.prototype =
{ {
return ExecuteNoHistory(function(){ return ExecuteNoHistory(function(){
var oParaDrawing = new ParaDrawing(); var oParaDrawing = new ParaDrawing();
oParaDrawing.Set_RelativeHeight(251659264);
oParaDrawing.Set_PositionH(c_oAscRelativeFromH.Page, true, c_oAscAlignH.Center, undefined); oParaDrawing.Set_PositionH(c_oAscRelativeFromH.Page, true, c_oAscAlignH.Center, undefined);
oParaDrawing.Set_PositionV(c_oAscRelativeFromV.Page, true, c_oAscAlignV.Center, undefined); oParaDrawing.Set_PositionV(c_oAscRelativeFromV.Page, true, c_oAscAlignV.Center, undefined);
oParaDrawing.Set_WrappingType(WRAPPING_TYPE_NONE); oParaDrawing.Set_WrappingType(WRAPPING_TYPE_NONE);
......
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