33 lines
938 B
PHP
33 lines
938 B
PHP
<?php
|
|
|
|
namespace swf2ass;
|
|
|
|
|
|
use swf2ass\actions\ActionList;
|
|
|
|
class ClippingViewLayout extends ViewLayout {
|
|
private int $clipDepth;
|
|
|
|
public function __construct(int $clipDepth, int $objectId, ?ObjectDefinition $object, ?ViewLayout $parent = null) {
|
|
$this->clipDepth = $clipDepth;
|
|
parent::__construct($objectId, $object, $parent);
|
|
}
|
|
|
|
public function getClipDepth(): int {
|
|
return $this->clipDepth;
|
|
}
|
|
|
|
public function nextFrame(ActionList $actionList): ClippingFrame {
|
|
$frame = parent::nextFrame($actionList);
|
|
|
|
$clip = new ClippingFrame($frame->getObjectId(), $this->getClipDepth(), $frame->getDrawPathList());
|
|
|
|
foreach ($frame->getDepthMap() as $depth => $f){
|
|
$clip->addChild($depth, $f);
|
|
}
|
|
$clip->setColorTransform($frame->getColorTransform());
|
|
$clip->setMatrixTransform($frame->getMatrixTransform());
|
|
|
|
return $clip;
|
|
}
|
|
} |