Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/dahall/Vanara
Browse files Browse the repository at this point in the history
  • Loading branch information
dahall committed Oct 25, 2022
2 parents 075b904 + e3d3075 commit 72cb218
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PInvoke/User32/Extensions/LOGFONTExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class LOGFONTExtension
/// <summary>Sets the point size of the font.</summary>
/// <param name="lf">The LOGFONT structure.</param>
/// <param name="value">The point size of the font.</param>
public static void SetPointSize(this LOGFONT lf, float value) => lf.lfHeight = (int)Math.Round(-value * GetDevicePixelsPerInchY() / 72);
public static void SetPointSize(this ref LOGFONT lf, float value) => lf.lfHeight = Convert.ToInt32(-value * GetDevicePixelsPerInchY() / 72);

private static int GetDevicePixelsPerInchY() => GetDeviceCaps(GetDC(GetDesktopWindow()), DeviceCap.LOGPIXELSY);
}
Expand Down

0 comments on commit 72cb218

Please sign in to comment.