mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 23:39:29 +02:00
Fix multiple warnings
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Drawing;
|
||||
|
||||
@@ -6,6 +7,8 @@ namespace DesktopMagic.Api.Drawing;
|
||||
|
||||
internal class FontComparer : IEqualityComparer<Font>
|
||||
{
|
||||
private const float Tolerance = 0.01f;
|
||||
|
||||
public bool Equals(Font? font1, Font? font2)
|
||||
{
|
||||
if (font1 is null || font2 is null)
|
||||
@@ -18,7 +21,7 @@ internal class FontComparer : IEqualityComparer<Font>
|
||||
return false;
|
||||
}
|
||||
|
||||
if (font1.SizeInPoints != font2.SizeInPoints)
|
||||
if (Math.Abs(font1.SizeInPoints - font2.SizeInPoints) > Tolerance)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user