From e11d27ab1b9afa7013dfa2d7b387686d18ba729c Mon Sep 17 00:00:00 2001 From: tkzcfc Date: Wed, 22 Oct 2025 14:51:57 +0800 Subject: [PATCH 1/2] fix: [ui::Text] Overflow::SHRINK does not restore the original font size when text is shortened https://github.com/axmolengine/axmol/issues/2830 --- core/2d/Label.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/2d/Label.cpp b/core/2d/Label.cpp index 870519bacec6..87689095f4b2 100644 --- a/core/2d/Label.cpp +++ b/core/2d/Label.cpp @@ -2574,6 +2574,9 @@ const Vec2& Label::getContentSize() const { if (_systemFontDirty || _contentDirty) { + if (_overflow == Overflow::SHRINK && this->getRenderingFontSize() < _originalFontSize) + const_cast(this)->rescaleWithOriginalFontSize(); + const_cast(this)->updateContent(); } return _contentSize; From 15862b5f99deab14d8dbcee33d2b5d0ee4e61a8b Mon Sep 17 00:00:00 2001 From: tkzcfc Date: Wed, 26 Nov 2025 13:45:04 +0800 Subject: [PATCH 2/2] Add path length checks to prevent out-of-bounds access in isAbsolutePathInternal --- core/platform/FileUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/platform/FileUtils.cpp b/core/platform/FileUtils.cpp index 83c61f0bd47e..8601d2bb00e4 100644 --- a/core/platform/FileUtils.cpp +++ b/core/platform/FileUtils.cpp @@ -933,7 +933,7 @@ bool FileUtils::isAbsolutePathInternal(std::string_view path) || (raw[0] == '/' || raw[0] == '\\') // Current disk drive ); #else - return (raw[0] == '/'); + return (path.length() > 0 && raw[0] == '/'); #endif }