Commit 6d335e28 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Доработана функция переноса/поворота картинки внутри одного параграфа....

Доработана функция переноса/поворота картинки внутри одного параграфа. Исправлен баг с рассчетом точки переноса картинок.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64278 954022d7-b5bf-4e40-9824-e11837661b57
parent 8af714fa
......@@ -8837,7 +8837,8 @@ Paragraph.prototype =
PageLimits = LD_PageLimits;
}
var Layout = new CParagraphLayout(DrawingLayout.X, DrawingLayout.Y , this.Get_StartPage_Absolute() + CurPage, DrawingLayout.LastW, ColumnStartX, ColumnEndX, X_Left_Margin, X_Right_Margin, Page_Width, Top_Margin, Bottom_Margin, Page_H, PageFields.X, PageFields.Y, this.Pages[CurPage].Y + this.Lines[CurLine].Y - this.Lines[CurLine].Metrics.Ascent, this.Pages[CurPage].Y);
var ParagraphTop = this.Lines[Para.Pages[CurPage].StartLine].Top + this.Pages[CurPage].Y;
var Layout = new CParagraphLayout(DrawingLayout.X, DrawingLayout.Y , this.Get_StartPage_Absolute() + CurPage, DrawingLayout.LastW, ColumnStartX, ColumnEndX, X_Left_Margin, X_Right_Margin, Page_Width, Top_Margin, Bottom_Margin, Page_H, PageFields.X, PageFields.Y, this.Pages[CurPage].Y + this.Lines[CurLine].Y - this.Lines[CurLine].Metrics.Ascent, ParagraphTop);
return {ParagraphLayout : Layout, PageLimits : PageLimits};
}
}
......
......@@ -4891,7 +4891,27 @@ ParaDrawing.prototype =
{
if ( null !== NearPos )
{
var Layout = NearPos.Paragraph.Get_Layout( NearPos.ContentPos, this );
var Layout = NearPos.Paragraph.Get_Layout(NearPos.ContentPos, this);
this.private_SetXYByLayout(X, Y, PageNum, Layout, true, true);
}
},
Set_XY : function(X, Y, Paragraph, PageNum, bResetAlign)
{
if (Paragraph)
{
var ContentPos = Paragraph.Get_DrawingObjectContentPos(this.Get_Id());
if (null === ContentPos)
return;
var Layout = Paragraph.Get_Layout(ContentPos, this);
this.private_SetXYByLayout(X, Y, PageNum, Layout, (bResetAlign || true !== this.PositionH.Align ? true : false), (bResetAlign || true !== this.PositionV.Align ? true : false));
}
},
private_SetXYByLayout : function(X, Y, PageNum, Layout, bChangeX, bChangeY)
{
this.PageNum = PageNum;
var _W = (this.PositionH.Align ? this.Extent.W : this.getXfrmExtX() );
var _H = (this.PositionV.Align ? this.Extent.H : this.getXfrmExtY() );
......@@ -4901,33 +4921,31 @@ ParaDrawing.prototype =
this.Internal_Position.Calculate_Y(false, c_oAscRelativeFromV.Page, false, Y - Layout.PageLimits.Y);
this.Internal_Position.Correct_Values(false, Layout.PageLimits, this.AllowOverlap, this.Use_TextWrap(), []);
this.PageNum = PageNum;
if (true === bChangeX)
{
this.X = this.Internal_Position.CalcX;
this.Y = this.Internal_Position.CalcY;
// Рассчитаем сдвиг с учетом старой привязки
var ValueX = this.Internal_Position.Calculate_X_Value(this.PositionH.RelativeFrom);
this.Set_PositionH( this.PositionH.RelativeFrom, false, ValueX );
this.Set_PositionH(this.PositionH.RelativeFrom, false, ValueX);
// На всякий случай пересчитаем заново координату
this.X = this.Internal_Position.Calculate_X(false, this.PositionH.RelativeFrom, this.PositionH.Align, this.PositionH.Value);
}
if (true === bChangeY)
{
this.Y = this.Internal_Position.CalcY;
// Рассчитаем сдвиг с учетом старой привязки
var ValueY = this.Internal_Position.Calculate_Y_Value(this.PositionV.RelativeFrom);
this.Set_PositionV( this.PositionV.RelativeFrom, false, ValueY );
this.Set_PositionV(this.PositionV.RelativeFrom, false, ValueY);
// На всякий случай пересчитаем заново координату
this.Y = this.Internal_Position.Calculate_Y(false, this.PositionV.RelativeFrom, this.PositionV.Align, this.PositionV.Value);
}
},
Set_XY : function(X, Y, Paragraph, PageNum, bResetAlign)
{
//TODO: Реализовать
this.Set_PositionH( c_oAscRelativeFromH.Page, false, X );
this.Set_PositionV( c_oAscRelativeFromV.Page, false, Y );
},
Get_DrawingType : function()
{
return this.DrawingType;
......
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