@@ -24,11 +24,11 @@ class Drawing
2424 /**
2525 * Convert pixels to EMU
2626 *
27- * @param int $pValue Value in pixels
27+ * @param float $pValue Value in pixels
2828 *
2929 * @return float
3030 */
31- public static function pixelsToEmu (int $ pValue = 0 ): float
31+ public static function pixelsToEmu (float $ pValue = 0 ): float
3232 {
3333 return round ($ pValue * 9525 );
3434 }
@@ -38,15 +38,15 @@ public static function pixelsToEmu(int $pValue = 0): float
3838 *
3939 * @param int $pValue Value in EMU
4040 *
41- * @return float
41+ * @return int
4242 */
43- public static function emuToPixels (int $ pValue = 0 ): float
43+ public static function emuToPixels (int $ pValue = 0 ): int
4444 {
4545 if ($ pValue == 0 ) {
4646 return 0 ;
4747 }
4848
49- return round ($ pValue / 9525 );
49+ return ( int ) round ($ pValue / 9525 );
5050 }
5151
5252 /**
@@ -96,11 +96,11 @@ public static function centimetersToPoints(float $pValue = 0): float
9696 /**
9797 * Convert points width to pixels
9898 *
99- * @param int $pValue Value in points
99+ * @param float $pValue Value in points
100100 *
101101 * @return float
102102 */
103- public static function pointsToPixels (int $ pValue = 0 ): float
103+ public static function pointsToPixels (float $ pValue = 0 ): float
104104 {
105105 if ($ pValue == 0 ) {
106106 return 0 ;
@@ -125,17 +125,17 @@ public static function pixelsToCentimeters(int $pValue = 0): float
125125 /**
126126 * Convert centimeters width to pixels
127127 *
128- * @param int $pValue Value in centimeters
128+ * @param float $pValue Value in centimeters
129129 *
130- * @return float
130+ * @return int
131131 */
132- public static function centimetersToPixels (int $ pValue = 0 ): float
132+ public static function centimetersToPixels (float $ pValue = 0 ): int
133133 {
134134 if ($ pValue == 0 ) {
135135 return 0 ;
136136 }
137137
138- return ($ pValue / 2.54 ) * self ::DPI_96 ;
138+ return (int ) round ((( $ pValue / 2.54 ) * self ::DPI_96 )) ;
139139 }
140140
141141 /**
@@ -246,6 +246,22 @@ public static function twipsToPixels(int $pValue = 0): float
246246 return round ($ pValue / 15 );
247247 }
248248
249+ /**
250+ * Convert points to emu
251+ *
252+ * @param float $pValue
253+ *
254+ * @return int
255+ */
256+ public static function pointsToEmu (float $ pValue = 0 ): int
257+ {
258+ if ($ pValue == 0 ) {
259+ return 0 ;
260+ }
261+
262+ return (int ) round (($ pValue / 0.75 ) / 9525 );
263+ }
264+
249265 /**
250266 * Convert HTML hexadecimal to RGB
251267 *
0 commit comments