Skip to content

Commit

Permalink
Fix duplicate entries on Calibration Curve legend in TestSmallMolecul…
Browse files Browse the repository at this point in the history
…esQuantificationTutorial (#3293)
  • Loading branch information
nickshulman authored Dec 22, 2024
1 parent a04685b commit 5948bd0
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected override void OnHandleCreated(EventArgs e)

private void Settings_OnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (DisplaySettings != null)
if (e.PropertyName == nameof(Properties.Settings.Default.CalibrationCurveOptions ))
{
Update(DisplaySettings);
}
Expand All @@ -94,12 +94,26 @@ protected override void OnHandleDestroyed(EventArgs e)
[Browsable(false)]
public Settings DisplaySettings { get; private set; }

private bool _inUpdate;
public void Update(Settings displaySettings)
{
DoUpdate(displaySettings);
GraphHelper.FormatFontSize(zedGraphControl.GraphPane, Options.FontSize);
zedGraphControl.AxisChange();
zedGraphControl.Invalidate();
if (_inUpdate)
{
return;
}

try
{
_inUpdate = true;
DoUpdate(displaySettings);
GraphHelper.FormatFontSize(zedGraphControl.GraphPane, Options.FontSize);
zedGraphControl.AxisChange();
zedGraphControl.Invalidate();
}
finally
{
_inUpdate = false;
}
}

public void Clear()
Expand Down

0 comments on commit 5948bd0

Please sign in to comment.