From 2729d2d49cee481f40a0a79f3996256991e9e721 Mon Sep 17 00:00:00 2001 From: Todd York Date: Thu, 1 Jan 2026 14:59:14 +0800 Subject: [PATCH] Refactor override_fake_italic() --- src/shape.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/shape.rs b/src/shape.rs index 6e2f1b8..523ec70 100644 --- a/src/shape.rs +++ b/src/shape.rs @@ -546,14 +546,11 @@ fn override_fake_italic( font: &Font, attrs: &Attrs, ) -> CacheKeyFlags { - cache_key_flags - | if !font.italic_or_oblique - && (attrs.style == Style::Italic || attrs.style == Style::Oblique) - { - CacheKeyFlags::FAKE_ITALIC - } else { - CacheKeyFlags::empty() - } + if !font.italic_or_oblique && (attrs.style == Style::Italic || attrs.style == Style::Oblique) { + cache_key_flags | CacheKeyFlags::FAKE_ITALIC + } else { + cache_key_flags + } } /// A shaped glyph