From afc3d5cb64a2430df0d14ae4f3dd8241e19f5b6a Mon Sep 17 00:00:00 2001 From: Bas-Jan 't Jong Date: Sun, 11 May 2014 09:16:36 +0200 Subject: [PATCH 1/2] Minor fix. If conversion factor from pointToPixel is 1.333333, then the conversion factor for PixelTopoint should be 0.75 --- src/PhpWord/Shared/Drawing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Shared/Drawing.php b/src/PhpWord/Shared/Drawing.php index f1d61eb6aa..5ee7e96087 100644 --- a/src/PhpWord/Shared/Drawing.php +++ b/src/PhpWord/Shared/Drawing.php @@ -56,7 +56,7 @@ public static function emuToPixels($value = 0) */ public static function pixelsToPoints($value = 0) { - return $value * 0.67777777; + return $value * 0.75; } /** From 539a173dc216fb243301113492bb3eb5ea62aad0 Mon Sep 17 00:00:00 2001 From: Bas-Jan 't Jong Date: Sun, 11 May 2014 09:18:19 +0200 Subject: [PATCH 2/2] Amended the corresponding test --- tests/PhpWord/Tests/Shared/DrawingTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PhpWord/Tests/Shared/DrawingTest.php b/tests/PhpWord/Tests/Shared/DrawingTest.php index 3fce6dc751..25fd3a3886 100644 --- a/tests/PhpWord/Tests/Shared/DrawingTest.php +++ b/tests/PhpWord/Tests/Shared/DrawingTest.php @@ -44,7 +44,7 @@ public function testUnitConversions() $this->assertEquals(round($value / 9525), $result); $result = Drawing::pixelsToPoints($value); - $this->assertEquals($value * 0.67777777, $result); + $this->assertEquals($value * 0.75, $result); $result = Drawing::pointsToPixels($value); $this->assertEquals($value * 1.333333333, $result);