when the find tab finds data in an array, have that line start at the start of the element, not directly with the search results.

This commit is contained in:
Benjamin Popp
2019-04-07 13:47:04 -05:00
parent f3abaf3a5f
commit 9e604435da

View File

@@ -633,8 +633,19 @@ namespace HavenSoft.HexManiac.Core.ViewModels {
public IChildViewPort CreateChildView(int startAddress, int endAddress) {
var child = new ChildViewPort(this);
child.Goto.Execute(startAddress.ToString("X2"));
child.SelectionEnd = child.ConvertAddressToViewPoint(endAddress);
var run = Model.GetNextRun(startAddress);
if (run is ArrayRun array) {
var offsets = array.ConvertByteOffsetToArrayOffset(startAddress);
var lineStart = array.Start + array.ElementLength * offsets.ElementIndex;
child.Goto.Execute(lineStart.ToString("X2"));
child.SelectionStart = child.ConvertAddressToViewPoint(startAddress);
child.SelectionEnd = child.ConvertAddressToViewPoint(endAddress);
} else {
child.Goto.Execute(startAddress.ToString("X2"));
child.SelectionEnd = child.ConvertAddressToViewPoint(endAddress);
}
return child;
}