From 45f30024935ab1f8290aa2193a02e4e76c50fa08 Mon Sep 17 00:00:00 2001
From: EdwardNutting_cp <4a0e5eaa1e4f1b941b4d24194acb591771a0e595xmSctDn6>
Date: Sat, 11 Jan 2014 17:48:29 +0000
Subject: [PATCH] ASM window now scrolls to approximately the correct place for
current line.
---
source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml | 2 +-
source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml
index ef8ce30db..9aa9b53ad 100644
--- a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml
+++ b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml
@@ -30,7 +30,7 @@
-->
-
+
diff --git a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs
index 20e1db09d..2008377b5 100644
--- a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs
+++ b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs
@@ -129,6 +129,7 @@ namespace Cosmos.VS.Windows
List xLabelPrefixes = new List();
bool foundMETHOD_Prefix = false;
bool foundMethodName = false;
+ int mCurrentLineNumber = 0;
foreach (var xLine in mLines)
{
string xDisplayLine = xLine.ToString();
@@ -186,6 +187,11 @@ namespace Cosmos.VS.Windows
if (tblkSource.Inlines.Count > 0)
{
tblkSource.Inlines.Add(new LineBreak());
+ if (!foundCurrentLine)
+ {
+ mCurrentLineNumber++;
+ }
+
mCode.AppendLine();
}
}
@@ -257,11 +263,19 @@ namespace Cosmos.VS.Windows
xRun.Foreground = Brushes.HotPink;
}
+ if (!foundCurrentLine)
+ {
+ mCurrentLineNumber++;
+ }
tblkSource.Inlines.Add(xRun);
tblkSource.Inlines.Add(new LineBreak());
mCode.AppendLine(xDisplayLine);
}
+ //EdMan196: This line of code was worked out by trial and error.
+ //If you change it proper testing/thinking, you will have to add RIP to your name.
+ double offset = mCurrentLineNumber * ((tblkSource.FontSize * tblkSource.FontFamily.LineSpacing) - 2.1);
+ ASMScrollViewer.ScrollToVerticalOffset(offset);
}
protected void OnASMCodeTextMouseUp(object aSender, System.Windows.Input.MouseButtonEventArgs aArgs)