From 9c9495f4ff0ecdf66d06ed33469d72290d708eef Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 11 May 2023 16:00:18 +0000 Subject: [PATCH] F2023-048: Beaver Valley long attachment section numbers overwrite section text in the editor --- PROMS/Volian.Controls.Library/RTBItem.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/RTBItem.cs b/PROMS/Volian.Controls.Library/RTBItem.cs index 2f623802..1b09a902 100644 --- a/PROMS/Volian.Controls.Library/RTBItem.cs +++ b/PROMS/Volian.Controls.Library/RTBItem.cs @@ -165,13 +165,16 @@ namespace Volian.Controls.Library if (!MyItemInfo.IsProcedure) lblTab.Text = tabString; // B2021-068: don't reset if procedure (it is blank when initialized) // calculate the width based upon characters per inch considering user's DPI - int cpi = MyItemInfo.IsStep ? (int)MyItemInfo.FormatStepData.TabData.Font.CPI : 12; + // F2023-048: Attachment text overwriting Attachment number. (Changed to 11 from 12) - note this + // was reported for Beaver Valley but could happen for any long section numbers + int cpi = MyItemInfo.IsStep ? (int)MyItemInfo.FormatStepData.TabData.Font.CPI : 11; // if the tab ends with a single digit & has a '.' before it, add space for the possibility // that the number can be two digits, for example... 8.1.9 goes to 8.1.10. We want // the step windows to line up, so the 8.1.9 has one character more space (lastDigitSingle) + // F2023-048: Attachment text overwriting Attachment number, only add 1 to label width if is a step tab bool lastDigitSingle = Regex.IsMatch(tabString, "^.*[^0-9][0-9] *$"); - lblTab.Width = ((lastDigitSingle ? 1 : 0) + tabString.Length) * MyStepPanel.DPI / cpi; + lblTab.Width = ((lastDigitSingle && MyItemInfo.IsStep ? 1 : 0) + tabString.Length) * MyStepPanel.DPI / cpi; Invalidate(); //if (MyItemInfo.MyTab.Offset == 0) // commented out for Farley bug fix B2015-123 alignment of tabs on the edit screen (Farly is only one using tab offset) {