From b34328ae8705bad4cc4b42dc72902cf9f8dae6a9 Mon Sep 17 00:00:00 2001
From: Christoph Flathmann <6141652+Chrissi2812@users.noreply.github.com>
Date: Sat, 27 Mar 2021 09:48:54 +0100
Subject: [PATCH] allow styles on <HR> tags (#250)

* allow styles on <HR> tags

* filter lineStyles before adding

Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>
---
 tcpdf.php | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/tcpdf.php b/tcpdf.php
index 18bd77d..cbc380a 100644
--- a/tcpdf.php
+++ b/tcpdf.php
@@ -7201,7 +7201,7 @@ class TCPDF {
 		} else {
 			$ximg = $x;
 		}
-		
+
 		if ($ismask OR $hidden) {
 			// image is not displayed
 			return $info['i'];
@@ -18897,7 +18897,18 @@ Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value:
 				}
 				$prevlinewidth = $this->GetLineWidth();
 				$this->SetLineWidth($hrHeight);
-				$this->Line($x, $y, $x + $hrWidth, $y);
+
+				$lineStyle = array(
+					'color' => $tag['fgcolor'],
+					'cap'   => $tag['style']['cap'],
+					'join'  => $tag['style']['join'],
+					'dash'  => $tag['style']['dash'],
+					'phase' => $tag['style']['phase'],
+				);
+
+				$lineStyle = array_filter($lineStyle);
+
+				$this->Line($x, $y, $x + $hrWidth, $y, $lineStyle);
 				$this->SetLineWidth($prevlinewidth);
 				$this->addHTMLVertSpace(max($hbc, ($hrHeight / 2)), 0, $cell, !isset($dom[($key + 1)]));
 				break;