File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public static function emuToPixels(int $pValue = 0): float
58
58
*/
59
59
public static function pixelsToPoints (int $ pValue = 0 ): float
60
60
{
61
- return $ pValue * 0.67777777 ;
61
+ return $ pValue * 0.75 ;
62
62
}
63
63
64
64
/**
@@ -74,7 +74,7 @@ public static function pointsToCentimeters(int $pValue = 0): float
74
74
return 0 ;
75
75
}
76
76
77
- return (($ pValue * 1.333333333 ) / self ::DPI_96 ) * 2.54 ;
77
+ return (($ pValue / 0.75 ) / self ::DPI_96 ) * 2.54 ;
78
78
}
79
79
80
80
/**
@@ -90,7 +90,7 @@ public static function pointsToPixels(int $pValue = 0): float
90
90
return 0 ;
91
91
}
92
92
93
- return $ pValue * 1.333333333 ;
93
+ return $ pValue / 0.75 ;
94
94
}
95
95
96
96
/**
@@ -227,7 +227,7 @@ public static function twipsToPixels(int $pValue = 0): float
227
227
return 0 ;
228
228
}
229
229
230
- return round ($ pValue / 15.873984 );
230
+ return round ($ pValue / 15 );
231
231
}
232
232
233
233
/**
Original file line number Diff line number Diff line change @@ -61,17 +61,17 @@ public function testPixelsPoints(): void
61
61
$ value = rand (1 , 100 );
62
62
63
63
$ this ->assertEquals (0 , Drawing::pixelsToPoints ());
64
- $ this ->assertEquals ($ value * 0.67777777 , Drawing::pixelsToPoints ($ value ));
64
+ $ this ->assertEquals ($ value * 0.75 , Drawing::pixelsToPoints ($ value ));
65
65
$ this ->assertEquals (0 , Drawing::pointsToPixels ());
66
- $ this ->assertEquals ($ value * 1.333333333 , Drawing::pointsToPixels ($ value ));
66
+ $ this ->assertEquals ($ value / 0.75 , Drawing::pointsToPixels ($ value ));
67
67
}
68
68
69
69
public function testPointsCentimeters (): void
70
70
{
71
71
$ value = rand (1 , 100 );
72
72
73
73
$ this ->assertEquals (0 , Drawing::pointsToCentimeters ());
74
- $ this ->assertEquals ($ value * 1.333333333 / Drawing::DPI_96 * 2.54 , Drawing::pointsToCentimeters ($ value ));
74
+ $ this ->assertEquals ($ value / 0.75 / Drawing::DPI_96 * 2.54 , Drawing::pointsToCentimeters ($ value ));
75
75
}
76
76
77
77
public function testTwips (): void
@@ -94,7 +94,7 @@ public function testTwips(): void
94
94
95
95
// Pixels
96
96
$ this ->assertEquals (0 , Drawing::twipsToPixels ());
97
- $ this ->assertEquals (round ($ value / 15.873984 ), Drawing::twipsToPixels ($ value ));
97
+ $ this ->assertEquals (round ($ value / 15 ), Drawing::twipsToPixels ($ value ));
98
98
}
99
99
100
100
public function testHTML (): void
You can’t perform that action at this time.
0 commit comments