forked from stevencohn/OneMore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix AlterSize to work across outlines (stevencohn#1480)
- Loading branch information
1 parent
38a7ecf
commit 6e3dbb0
Showing
4 changed files
with
107 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//************************************************************************************************ | ||
// Copyright © 2024 Steven M Cohn. All rights reserved. | ||
//************************************************************************************************ | ||
|
||
namespace River.OneMoreAddIn | ||
{ | ||
using System; | ||
|
||
|
||
internal static class DoubleExtensions | ||
{ | ||
/// <summary> | ||
/// OneMore Extension >> Compares two Doubles with a specified epsilon window. | ||
/// </summary> | ||
/// <param name="a">This Double</param> | ||
/// <param name="b">That Double</param> | ||
/// <param name="epsilon"> | ||
/// The fudge factor for comparison. This defaults to 0.5 which is good for | ||
/// font size comparisons, our most common use case in OneMore | ||
/// </param> | ||
/// <returns>True if the two values are within the specified epsilon difference</returns> | ||
public static bool Equalsish(this double a, double b, double epsilon = 0.5) | ||
{ | ||
return Math.Abs(a - b) < epsilon; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters