From cd446a523845419ad2c95cf967789c2ef7839cd4 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Fri, 15 May 2020 08:40:18 -0400 Subject: [PATCH] don't let the NumericTextBoxes cause selection to change more than once --- .../Editors/Binary/BinaryEditor.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Libraries/UniversalEditor.UserInterface/Editors/Binary/BinaryEditor.cs b/Libraries/UniversalEditor.UserInterface/Editors/Binary/BinaryEditor.cs index 91957699..d9a28d7f 100644 --- a/Libraries/UniversalEditor.UserInterface/Editors/Binary/BinaryEditor.cs +++ b/Libraries/UniversalEditor.UserInterface/Editors/Binary/BinaryEditor.cs @@ -511,17 +511,20 @@ namespace UniversalEditor.Editors.Binary [EventHandler(nameof(txtStart), "Changed")] private void txtStart_Changed(object sender, EventArgs e) { - hexedit.SelectionStart = new HexEditorPosition((int)txtStart.Value, 0); + if (hexedit.SelectionStart.ByteIndex != (int)txtStart.Value) + hexedit.SelectionStart = new HexEditorPosition((int)txtStart.Value, 0); } [EventHandler(nameof(txtEnd), "Changed")] private void txtEnd_Changed(object sender, EventArgs e) { - hexedit.SelectionLength = new HexEditorPosition((int)txtEnd.Value - hexedit.SelectionStart, 0); + if (hexedit.SelectionLength.ByteIndex != (int)txtEnd.Value - hexedit.SelectionStart) + hexedit.SelectionLength = new HexEditorPosition((int)txtEnd.Value - hexedit.SelectionStart, 0); } [EventHandler(nameof(txtLength), "Changed")] private void txtLength_Changed(object sender, EventArgs e) { - hexedit.SelectionLength = new HexEditorPosition((int)txtLength.Value, 0); + if (hexedit.SelectionLength.ByteIndex != (int)txtLength.Value) + hexedit.SelectionLength = new HexEditorPosition((int)txtLength.Value, 0); } [EventHandler(nameof(hexedit), "Changing")]