Skip to content

Commit ec7236e

Browse files
committed
Add missing OPACITY in STYLE
1 parent 4150130 commit ec7236e

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/Parser/Style.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ public function parse($content = null): StyleObject
9797
intval($matches[1]),
9898
intval($matches[2]),
9999
];
100+
} elseif ($this->parsing === 'STYLE' && preg_match('/^OPACITY ([0-9]+)$/i', $line, $matches)) {
101+
$style->opacity = intval($matches[1]);
102+
} elseif ($this->parsing === 'STYLE' && preg_match('/^OPACITY (\[.+\])$/i', $line, $matches)) {
103+
$style->opacity = $matches[1];
100104
} elseif ($this->parsing === 'STYLE' && preg_match('/^OUTLINECOLOR ([0-9]+) ([0-9]+) ([0-9]+)$/i', $line, $matches)) {
101105
$style->outlinecolor = [
102106
intval($matches[1]),

src/Writer/Style.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function write($style, int $indentSize = 0, string $indent = self::WRITER
3434
$this->text .= self::getText('MINSCALEDENOM', $style->minscaledenom, $indentSize + 1, $indent);
3535
$this->text .= self::getText('MINSIZE', $style->minsize, $indentSize + 1, $indent);
3636
$this->text .= self::getTextArray('OFFSET', $style->offset, $indentSize + 1, $indent);
37+
$this->text .= self::getText('OPACITY', $style->opacity, $indentSize + 1, $indent);
3738
$this->text .= is_array($style->outlinecolor) ? self::getTextArray('OUTLINECOLOR', $style->outlinecolor, $indentSize + 1, $indent) : self::getTextString('OUTLINECOLOR', $style->outlinecolor, $indentSize + 1, $indent);
3839
$this->text .= self::getText('OUTLINEWIDTH', $style->outlinewidth, $indentSize + 1, $indent);
3940

0 commit comments

Comments
 (0)