B2016-264: Inserting a centered equation off a centered equation places 2nd equation too far to left in step editor

This commit is contained in:
Kathy Ruffing 2016-11-30 14:16:53 +00:00
parent 651ce71dc1
commit b242d57d4b
2 changed files with 12 additions and 5 deletions

View File

@ -1869,16 +1869,23 @@ namespace Volian.Controls.Library
parentEI = parentEI._MyPreviousEditItem;
myParentEditItem = parentEI._MyParentEditItem;
}
// Should center on parent unless it is a centered table in the AER column
int center = myParentEditItem.ContentLeft + myParentEditItem.ContentWidth / 2;
int rightLimit = myParentEditItem.Right;
// Should center on parent unless it is a centered table type in the AER column or parent is another table type, then
// walk up until finding a non-table type step'. (B2016-264: insert of centered eq off centered eq was not locating child equation correctly)
EditItem aboveForLocation = myParentEditItem;
if (aboveForLocation.MyItemInfo.IsTable || aboveForLocation.MyItemInfo.IsRtfRaw || aboveForLocation.MyItemInfo.IsFigure)
{
while (aboveForLocation.MyItemInfo.IsFigure || aboveForLocation.MyItemInfo.IsRtfRaw || aboveForLocation.MyItemInfo.IsTable) aboveForLocation = aboveForLocation.MyParentEditItem;
}
int center = aboveForLocation.ContentLeft + aboveForLocation.ContentWidth / 2;
int rightLimit = aboveForLocation.Right;
// Then should center on the wid Limit
if (MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0)
{
int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode);
rightLimit += colR * MyItemInfo.ColumnMode;
center += (colR * MyItemInfo.ColumnMode) / 2;
center -= (myParentEditItem.ContentLeft - (int)MyItemInfo.MyDocStyle.Layout.LeftMargin) / 2;
center -= (aboveForLocation.ContentLeft - (int)MyItemInfo.MyDocStyle.Layout.LeftMargin) / 2;
}
// Calulate the x location

View File

@ -284,10 +284,10 @@ namespace Volian.Controls.Library
{
MyStepRTB.OrigRTF = "";
MyStepRTB.Size = new Size(200, 200);
ItemLocation = TableLocation(MyStepSectionLayoutData, ItemWidth);
Width = 200;
Height = 200;
ItemWidth = Width;
ItemLocation = TableLocation(MyStepSectionLayoutData, ItemWidth);
}
this.Controls.Add(this._MyStepRTB);
}