Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| FeOffset | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| dx | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| dy | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Phpdftk\Svg\Filter; |
| 6 | |
| 7 | /** |
| 8 | * SVG 2 Filter Effects §15.12 — `<feOffset dx dy>`. Translates |
| 9 | * the input by `(dx, dy)` in the filter's coordinate space. |
| 10 | * Used heavily in drop-shadow chains together with SourceAlpha |
| 11 | * + feGaussianBlur. |
| 12 | */ |
| 13 | final class FeOffset extends FilterPrimitive |
| 14 | { |
| 15 | public function __construct() |
| 16 | { |
| 17 | parent::__construct('feOffset'); |
| 18 | } |
| 19 | |
| 20 | public function dx(): float |
| 21 | { |
| 22 | return (float) ($this->getAttribute('dx') ?? 0); |
| 23 | } |
| 24 | |
| 25 | public function dy(): float |
| 26 | { |
| 27 | return (float) ($this->getAttribute('dy') ?? 0); |
| 28 | } |
| 29 | } |