diff --git a/PROMS/Volian.Controls.Library/EditItem.cs b/PROMS/Volian.Controls.Library/EditItem.cs index b8fb98a6..f3fee107 100644 --- a/PROMS/Volian.Controls.Library/EditItem.cs +++ b/PROMS/Volian.Controls.Library/EditItem.cs @@ -2266,6 +2266,9 @@ namespace Volian.Controls.Library //vlnStackTrace.ShowStack("CenterScroll {0} Current {1} Top {2} Bottom {3} Limit {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, Top, Bottom, _Panel.Height);// Show StackTrace //Console.WriteLine("CenterScroll {0} Current {1} Top {2} Bottom {3} Limit {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, Top, Bottom, _Panel.Height); if (Top >= 0 && Bottom <= MyStepPanel.Height) return;// Don't move if within screen. + // C2023-008: if step is larger than the current step panel height, don't center. This was shifting step so that + // if text was changed closer to bottom of step, the change was no longer visible. + if ((Bottom - Top) > _MyStepPanel.Height) return; int scrollValue = MyStepPanel.VerticalScroll.Value + (Top - (MyStepPanel.Height / 2)); // calculate scroll center for the item // Limit scroll location within allowable values scrollValue = Math.Max(MyStepPanel.VerticalScroll.Minimum, Math.Min(MyStepPanel.VerticalScroll.Maximum, scrollValue));