diff --git a/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp b/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp index de5ad2da5a..546164d20a 100644 --- a/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp +++ b/native/cocos/platform/android/CCCanvasRenderingContext2D-android.cpp @@ -359,7 +359,7 @@ void CanvasRenderingContext2D::set_textBaseline(const std::string& textBaseline) { _impl->setTextBaseline(CanvasTextBaseline::MIDDLE); } - else if (textBaseline == "bottom") + else if (textBaseline == "bottom" || textBaseline == "alphabetic") //TODO:cjh, how to deal with alphabetic, currently we handle it as bottom mode. { _impl->setTextBaseline(CanvasTextBaseline::BOTTOM); } diff --git a/native/cocos/platform/ios/CCCanvasRenderingContext2D-ios.mm b/native/cocos/platform/ios/CCCanvasRenderingContext2D-ios.mm index d9d8f82848..cae9984620 100644 --- a/native/cocos/platform/ios/CCCanvasRenderingContext2D-ios.mm +++ b/native/cocos/platform/ios/CCCanvasRenderingContext2D-ios.mm @@ -518,7 +518,7 @@ void CanvasRenderingContext2D::set_textBaseline(const std::string& textBaseline) { _impl.textBaseLine = CanvasTextBaseline::MIDDLE; } - else if (textBaseline == "bottom") + else if (textBaseline == "bottom" || textBaseline == "alphabetic") //TODO:cjh, how to deal with alphabetic, currently we handle it as bottom mode. { _impl.textBaseLine = CanvasTextBaseline::BOTTOM; } diff --git a/native/cocos/platform/mac/CCCanvasRenderingContext2D-mac.mm b/native/cocos/platform/mac/CCCanvasRenderingContext2D-mac.mm index 5aad04dea1..f0c6f3870b 100644 --- a/native/cocos/platform/mac/CCCanvasRenderingContext2D-mac.mm +++ b/native/cocos/platform/mac/CCCanvasRenderingContext2D-mac.mm @@ -522,7 +522,7 @@ void CanvasRenderingContext2D::set_textBaseline(const std::string& textBaseline) { _impl.textBaseLine = CanvasTextBaseline::MIDDLE; } - else if (textBaseline == "bottom") + else if (textBaseline == "bottom" || textBaseline == "alphabetic") //TODO:cjh, how to deal with alphabetic, currently we handle it as bottom mode. { _impl.textBaseLine = CanvasTextBaseline::BOTTOM; }