Skip to content

Commit

Permalink
Merge pull request #51 from SunflowerFuchs/develop
Browse files Browse the repository at this point in the history
Fix pointsToEmu calculation
  • Loading branch information
Progi1984 authored Dec 11, 2023
2 parents 97b9bef + 7d9c7a8 commit 8303744
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Common/Drawing.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public static function pointsToEmu(float $pValue = 0): int
return 0;
}

return (int) round(($pValue / 0.75) / 9525);
return (int) round(($pValue / 0.75) * 9525);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Common/Tests/DrawingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testPointsEmu(): void
$value = rand(1, 100);

$this->assertEquals(0, Drawing::pointsToEmu());
$this->assertEquals(round($value / 0.75 / 9525), Drawing::pointsToEmu($value));
$this->assertEquals(round($value / 0.75 * 9525), Drawing::pointsToEmu($value));
}

public function testCentimetersPoints(): void
Expand Down

0 comments on commit 8303744

Please sign in to comment.