mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 08:56:15 +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;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace DesktopMagic.Api.Settings;
|
||||
|
||||
@@ -22,6 +23,7 @@ public sealed class Slider : Setting
|
||||
/// <summary>
|
||||
/// Gets or sets the value assigned to the <see cref="Slider"/> element.
|
||||
/// </summary>
|
||||
[SuppressMessage("Major Bug", "S1244:Floating point numbers should not be tested for equality", Justification = "Not applicable here since we want to detect changes in the value.")]
|
||||
public double Value
|
||||
{
|
||||
get => _value;
|
||||
|
||||
Reference in New Issue
Block a user