@@ -13,21 +13,16 @@ namespace Standard
13
13
14
14
internal static class DpiHelper
15
15
{
16
- [ ThreadStatic ]
17
- private static Matrix _transformToDevice ;
18
- [ ThreadStatic ]
19
- private static Matrix _transformToDip ;
20
-
21
16
/// <summary>
22
17
/// Convert a point in device independent pixels (1/96") to a point in the system coordinates.
23
18
/// </summary>
24
19
/// <param name="logicalPoint">A point in the logical coordinate system.</param>
25
20
/// <returns>Returns the parameter converted to the system's coordinates.</returns>
26
21
public static Point LogicalPixelsToDevice ( Point logicalPoint , double dpiScaleX , double dpiScaleY )
27
22
{
28
- _transformToDevice = Matrix . Identity ;
29
- _transformToDevice . Scale ( dpiScaleX , dpiScaleY ) ;
30
- return _transformToDevice . Transform ( logicalPoint ) ;
23
+ Matrix transformToDevice = Matrix . Identity ;
24
+ transformToDevice . Scale ( dpiScaleX , dpiScaleY ) ;
25
+ return transformToDevice . Transform ( logicalPoint ) ;
31
26
}
32
27
33
28
/// <summary>
@@ -37,9 +32,9 @@ public static Point LogicalPixelsToDevice(Point logicalPoint, double dpiScaleX,
37
32
/// <returns>Returns the parameter converted to the device independent coordinate system.</returns>
38
33
public static Point DevicePixelsToLogical ( Point devicePoint , double dpiScaleX , double dpiScaleY )
39
34
{
40
- _transformToDip = Matrix . Identity ;
41
- _transformToDip . Scale ( 1d / dpiScaleX , 1d / dpiScaleY ) ;
42
- return _transformToDip . Transform ( devicePoint ) ;
35
+ Matrix transformToDip = Matrix . Identity ;
36
+ transformToDip . Scale ( 1d / dpiScaleX , 1d / dpiScaleY ) ;
37
+ return transformToDip . Transform ( devicePoint ) ;
43
38
}
44
39
45
40
[ SuppressMessage ( "Microsoft.Performance" , "CA1811:AvoidUncalledPrivateCode" ) ]
0 commit comments