Skip to content

Commit

Permalink
Merge pull request PHP-FFMpeg#407 from letungit90/master
Browse files Browse the repository at this point in the history
support crop with dynamic point
  • Loading branch information
jens1o committed Sep 19, 2017
2 parents 96225b2 + 47b8d84 commit ef0ece8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/FFMpeg/Coordinate/Point.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ class Point
private $x;
private $y;

public function __construct($x, $y)
public function __construct($x, $y, $dynamic = false)
{
$this->x = (int) $x;
$this->y = (int) $y;
if ($dynamic) {
$this->x = $x;
$this->y = $y;
} else {
$this->x = (int)$x;
$this->y = (int)$y;
}
}

/**
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Coordinate/PointTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ public function testGetters()
$this->assertEquals(4, $point->getX());
$this->assertEquals(25, $point->getY());
}

public function testDynamicPointGetters()
{
$point = new Point("t*100", "t", true);
$this->assertEquals("t*100", $point->getX());
$this->assertEquals("t", $point->getY());
}
}

0 comments on commit ef0ece8

Please sign in to comment.