Add custom marker color property

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2026-05-22 08:33:29 -07:00
parent 074f02d301
commit 8c65194aea

View File

@@ -141,11 +141,12 @@ class AnnotationHandler extends CodeContentHandler {
); );
$maskCirc = Html::rawElement('circle',$attrMask); $maskCirc = Html::rawElement('circle',$attrMask);
array_push($maskCircles,$maskCirc); array_push($maskCircles,$maskCirc);
$markColor = isset($annot['color']) ? $annot['color'] : '#ff0000';
$attrMarkerCirc = array( $attrMarkerCirc = array(
'cx' => $annot['position']['0'], 'cx' => $annot['position']['0'],
'cy' => $annot['position']['1'], 'cy' => $annot['position']['1'],
'r' => '3.75', 'r' => '3.75',
'style' => 'fill-opacity: .35; stroke-linejoin: bevel; stroke-width: .3793; stroke: #ff0000;', 'style' => "fill-opacity: .35; stroke-linejoin: bevel; stroke-width: .3793; stroke: {$markColor};",
'fill' => (isset($annot['light']) && $annot['light']) ? 'white' : 'black' 'fill' => (isset($annot['light']) && $annot['light']) ? 'white' : 'black'
); );
$markCirc = Html::rawElement('circle',$attrMarkerCirc); $markCirc = Html::rawElement('circle',$attrMarkerCirc);
@@ -153,7 +154,7 @@ class AnnotationHandler extends CodeContentHandler {
$attrMarkerText = array( $attrMarkerText = array(
'x' => $annot['position']['0'], 'x' => $annot['position']['0'],
'y' => $annot['position']['1'], 'y' => $annot['position']['1'],
'style' => 'fill: #ff0000; font-size: 5px; stroke-linejoin: bevel; stroke-width: .6968; text-align: center; text-anchor: middle; transform: translateY(1.5px);' 'style' => "fill: {$markColor}; font-size: 5px; stroke-linejoin: bevel; stroke-width: .6968; text-align: center; text-anchor: middle; transform: translateY(1.5px);"
); );
$markText = Html::rawElement('text',$attrMarkerText, isset($annot['label']) ? $annot['label'] : $label ); $markText = Html::rawElement('text',$attrMarkerText, isset($annot['label']) ? $annot['label'] : $label );
array_push($markers,$markText); array_push($markers,$markText);