aboutsummaryrefslogtreecommitdiffstatsci
path: root/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-08-02 14:36:36 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-08-02 14:36:36 +0200
commitd65351d324043f7c9d74f6dcf966ea40792017a5 (patch)
tree31915006ecee0c90c6deb3fa898d7e2b81b5ec3f /Samples/DebugLogAnalyzer/src/DbgLogViewer.cs
parent85190e474cae0a87e29755c156140cd29c85cbb5 (diff)
merge step 2
Diffstat (limited to 'Samples/DebugLogAnalyzer/src/DbgLogViewer.cs')
-rw-r--r--Samples/DebugLogAnalyzer/src/DbgLogViewer.cs21
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)";