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 = ...@@ -8837,7 +8837,8 @@ Paragraph.prototype =
PageLimits = LD_PageLimits; 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}; return {ParagraphLayout : Layout, PageLimits : PageLimits};
} }
} }
......
...@@ -4891,43 +4891,61 @@ ParaDrawing.prototype = ...@@ -4891,43 +4891,61 @@ ParaDrawing.prototype =
{ {
if ( null !== NearPos ) 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 _W = (this.PositionH.Align ? this.Extent.W : this.getXfrmExtX() );
var _H = (this.PositionV.Align ? this.Extent.H : this.getXfrmExtY() ); var _H = (this.PositionV.Align ? this.Extent.H : this.getXfrmExtY() );
this.Internal_Position.Set(_W, _H, this.YOffset, Layout.ParagraphLayout, Layout.PageLimits); this.Internal_Position.Set(_W, _H, this.YOffset, Layout.ParagraphLayout, Layout.PageLimits);
this.Internal_Position.Calculate_X(false, c_oAscRelativeFromH.Page, false, X - Layout.PageLimits.X); this.Internal_Position.Calculate_X(false, c_oAscRelativeFromH.Page, false, X - Layout.PageLimits.X);
this.Internal_Position.Calculate_Y(false, c_oAscRelativeFromV.Page, false, Y - Layout.PageLimits.Y); 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.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; this.X = this.Internal_Position.CalcX;
// Рассчитаем сдвиг с учетом старой привязки // Рассчитаем сдвиг с учетом старой привязки
var ValueX = this.Internal_Position.Calculate_X_Value(this.PositionH.RelativeFrom); 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); 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); 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); 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() Get_DrawingType : function()
{ {
return this.DrawingType; 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