Skip to content

Commit

Permalink
Code style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev committed Dec 10, 2023
1 parent d84692f commit 8e29dae
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ public function computeStringWidth(
private function getGlyphHorizontalAdvance(
Character $character,
): int {
if (!isset($this->glyphs[strval($character)])) {
return $this->missingGlyph->horizontalAdvance
?? $this->horizontalAdvance;
}

return $this->glyphs[strval($character)]->horizontalAdvance
?? $this->horizontalAdvance;
return isset($this->glyphs[strval($character)])
? $this->glyphs[strval($character)]->horizontalAdvance ?? $this->horizontalAdvance
: $this->missingGlyph->horizontalAdvance ?? $this->horizontalAdvance;
}
}

0 comments on commit 8e29dae

Please sign in to comment.