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:
@@ -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
|
||||
|
Reference in New Issue
Block a user