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