Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Jun 7, 2024
1 parent c6e9272 commit 6ed1910
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ opencover.xml
/projects/GKv3/packages/**/
.idea/
adb-copy.cmd

GEDKeeper2Lux.sln
/projects/plugins/GKLuxTree/
10 changes: 10 additions & 0 deletions projects/GKCore/GKCore/Charts/ChartRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ protected ChartRenderer()
{
}

public virtual void SetViewport(int width, int height)
{
// dummy
}

public abstract void SetSmoothing(bool value);

public virtual void BeginDrawing()
Expand Down Expand Up @@ -158,6 +163,11 @@ public abstract void DrawRoundedRectangle(IPen pen, IColor fillColor, float x, f

public abstract void DrawPath(IPen pen, IBrush brush, IGfxPath path);

public virtual IFont CreateFont(string fontName, float size, bool bold)
{
return AppHost.GfxProvider.CreateFont(fontName, size, bold);
}

public IPen CreatePen(int argb, float width = 1.0f)
{
return CreatePen(GetColor(argb), width);
Expand Down
5 changes: 3 additions & 2 deletions projects/GKCore/GKCore/Charts/TreeChartModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,9 @@ private void Predef()
// https://social.msdn.microsoft.com/Forums/en-US/98717e53-89f7-4d5f-823b-7184781a7b85/wpf-formattedtext-randomly-disappears-in-high-resolution-images
fsz = Math.Max(fsz, 5.0f);
#endif
fBoldFont = AppHost.GfxProvider.CreateFont(fOptions.DefFontName, fsz, true);
fDrawFont = AppHost.GfxProvider.CreateFont(fOptions.DefFontName, fsz, false);
string fontName = fOptions.DefFontName;
fBoldFont = fRenderer.CreateFont(fontName, fsz, true);
fDrawFont = fRenderer.CreateFont(fontName, fsz, false);
if (fRenderer != null) {
fDefCharWidth = fRenderer.GetTextWidth("A", fDrawFont);
}
Expand Down

0 comments on commit 6ed1910

Please sign in to comment.