protected function transformPath($path, $scale, $roundPrecision, $flip, $xOffset, $yOffset){

		if($flip === 'horizontal' || $flip === 'vertical'){
			$viewBox = $this->getViewBox();
		}

		return preg_replace_callback('([m,l,h,v,c,s,q,t,a,z](?:[\\s,]*-?(?=\\.?\\d)\\d*(?:\\.\\d+)?)*)i', function($maches) use ($scale, $roundPrecision, $flip, $xOffset, $yOffset, $viewBox){

			$command = substr($maches[0], 0, 1);
			$absoluteCommand = strtoupper($command) === $command;
			$xyCommand = in_array(strtolower($command), array('m','l','c','s','q','t'));
			$xCommand = strtolower($command) === 'h';
			$yCommand = strtolower($command) === 'v';
			if(strtolower($command) === 'z'){
				return $command;
			}
			if(strtolower($command) === 'a'){
				throw new \Exception('Path command "A" is currently not supportet!');
			}
			$values = $this->getValuesFromList(substr($maches[0], 1));

			foreach($values as $key => $value) {

				if(
					$flip === 'horizontal' &&
					((!($key%2) && $xyCommand) || $xCommand)
				){
					$values[$key] *= -1;
					if($absoluteCommand){
						$values[$key] += $viewBox['width'];
					}
				}
				if(
					$flip === 'vertical' &&
					(($key%2 && $xyCommand) || $yCommand)
				){
					$values[$key] *= -1;
					if($absoluteCommand){
						$values[$key] += $viewBox['height'];
					}
				}
				if(
					$absoluteCommand &&
					((!($key%2) && $xyCommand) || $xCommand)
				){
					$values[$key] += $xOffset;
				}
				if(
					$absoluteCommand &&
					(($key%2 && $xyCommand) || $yCommand)
				){
					$values[$key] += $yOffset;
				}
				$values[$key] *= $scale;
				if($roundPrecision !== null){
					$values[$key] = round($values[$key], $roundPrecision);
				}

			}

			return $command.implode(' ', $values);

		}, $path);

	}