diff options
Diffstat (limited to 'Samples/DebugLogAnalyzer/src/DbgLogViewer.cs')
| -rw-r--r-- | Samples/DebugLogAnalyzer/src/DbgLogViewer.cs | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs b/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs index 086e7152..7b91f9f0 100644 --- a/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs +++ b/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs @@ -1,18 +1,15 @@ -using System.Diagnostics; -using System.Runtime.InteropServices.ComTypes; -// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// Copyright (c) 2013-2021 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) using System; using System.Collections.Generic; using System.ComponentModel; -using System.IO; using System.Linq; using System.Threading.Tasks; using Crow.Drawing; using Crow.DebugLogger; -using DebugLogAnalyzer; +using System.Diagnostics; namespace Crow { @@ -194,9 +191,7 @@ namespace Crow set { base.Font = value; using (Context gr = new Context (IFace.surf)) { - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); - + setFontForContext (gr); fe = gr.FontExtents; } updateMargins (); @@ -262,7 +257,7 @@ namespace Crow } DbgEvtType currentFilter; - protected override void onDraw (Cairo.Context gr) + protected override void onDraw (Context gr) { base.onDraw (gr); @@ -346,7 +341,7 @@ namespace Crow } string ticksToMS(long ticks) => Math.Round ((double)ticks / Stopwatch.Frequency * 1000.0, 2).ToString(); - public override void Paint (Cairo.Context ctx) + public override void Paint (Context ctx) { base.Paint (ctx); @@ -386,7 +381,7 @@ namespace Crow ctx.MoveTo (ctxR.X - ctx.TextExtents (str).Width / 2, ctxR.Y + fe.Height); ctx.ShowText (str); - ctx.Operator = Cairo.Operator.Add; + ctx.Operator = Operator.Add; if (hoverLine >= 0) { double y = fe.Height * (hoverLine - ScrollY) + topMargin + cb.Top; @@ -413,7 +408,7 @@ namespace Crow } if (selStart < 0 || selEnd < 0) { - ctx.Operator = Cairo.Operator.Over; + ctx.Operator = Operator.Over; return; } double selStartX = (double)(selStart - ScrollX - minTicks) * xScale + leftMargin + cb.Left; @@ -432,7 +427,7 @@ namespace Crow ctx.SetSource (0.0,0.2,0.8,0.15); //ctx.SetSource (Colors.Jet); ctx.Fill(); - ctx.Operator = Cairo.Operator.Over; + ctx.Operator = Operator.Over; str = $"{ticksToMS(Math.Abs (selEnd - selStart))} (ms)"; |