From 5b52ffb27749a35244cfa4e3212cf670efbdfc74 Mon Sep 17 00:00:00 2001 From: Jayden Date: Thu, 14 Nov 2024 12:26:15 +0800 Subject: [PATCH] Bug fix: label alignment is wrong under certain conditions --- FireworkVideoUI.podspec | 2 +- .../AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/FireworkVideoUI.podspec b/FireworkVideoUI.podspec index cc98858..c509a06 100644 --- a/FireworkVideoUI.podspec +++ b/FireworkVideoUI.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'FireworkVideoUI' - s.version = '0.2.2' + s.version = '0.2.3' s.summary = 'An extension library meant to provide easier interfaces for the FireworkVideoSDK.' s.homepage = 'https://github.com/loopsocial/firework_ios_sdk_ui_extensions' s.license = 'Apache License, Version 2.0' diff --git a/Sources/FireworkVideoUI/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift b/Sources/FireworkVideoUI/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift index fbbe38e..7b632ac 100644 --- a/Sources/FireworkVideoUI/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift +++ b/Sources/FireworkVideoUI/AppLanguage/Extensions/UIKit/UILabel+AppLanguage.swift @@ -79,7 +79,11 @@ extension UILabel { return .right } } else if layoutDirection == .ltr { - return .left + if textAlignment == .center { + return textAlignment + } else { + return .left + } } } else { return textAlignment