public function copyTo(LayerManager $other) 
    {
        $other->color = $this->color;
        
        $layer = $this->topLayer;
        $previousCopy = null;
        
        while ($layer !== null) {
            $copy = new Layer(
                $layer->polygonId,
                $layer->color,
                $layer->winding,
                $layer->windingRule
                );
            
            if ($previousCopy === null) {
                $other->topLayer = $copy;
            }
            else {
                $previousCopy->nextLayer = $copy;
            }
            
            $previousCopy = $copy;
            $layer = $layer->nextLayer;
        }
    }
public function copyTo(LayerManager $other) 
    {
        $other->color = $this->color;
        
        $layer = $this->topLayer;
        $previousCopy = null;
        
        while ($layer !== null) {
            $copy = new Layer(
                $layer->polygonId,
                $layer->color,
                $layer->winding,
                $layer->windingRule
                );
            
            if ($previousCopy === null) {
                $other->topLayer = $copy;
            }
            else {
                $previousCopy->nextLayer = $copy;
            }
            
            $previousCopy = $copy;
            $layer = $layer->nextLayer;
        }
    }
public function copyTo ( LayerManager $ other ) { $ other -> color = $ this -> color ; $ layer = $ this -> topLayer ; $ previousCopy = null ; while ( $ layer !== null ) { $ copy = new Layer ( $ layer -> polygonId , $ layer -> color , $ layer -> winding , $ layer -> windingRule ) ; if ( $ previousCopy === null ) { $ other -> topLayer = $ copy ; } else { $ previousCopy -> nextLayer = $ copy ; } $ previousCopy = $ copy ; $ layer = $ layer -> nextLayer ; } }
Copies all layers in this manager to another LayerManager.

@param \Jdenticon\Canvas\Rasterization\LayerManager $other The
LayerManager to copy all layers to.
Copies all layers in this manager to another LayerManager .