Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows;
|
---|
6 |
|
---|
7 | namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
|
---|
8 | {
|
---|
9 | internal static class SizeExtensions
|
---|
10 | {
|
---|
11 | private const double sizeRatio = 1e-7;
|
---|
12 | public static bool EqualsApproximately(this Size size1, Size size2)
|
---|
13 | {
|
---|
14 | bool widthEquals = Math.Abs(size1.Width - size2.Width) / size1.Width < sizeRatio;
|
---|
15 | bool heightEquals = Math.Abs(size1.Height - size2.Height) / size1.Height < sizeRatio;
|
---|
16 |
|
---|
17 | return widthEquals && heightEquals;
|
---|
18 | }
|
---|
19 | }
|
---|
20 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.