mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 09:10:54 +00:00
!9827 ellipsis 增加默认值
Merge pull request !9827 from luhan/add_default_value
This commit is contained in:
commit
8c7127a92f
@ -105,6 +105,7 @@ struct TypographyStyle {
|
||||
bool customTextStyle = false;
|
||||
TextHeightBehavior textHeightBehavior = TextHeightBehavior::ALL;
|
||||
bool hintingIsOn = false;
|
||||
bool ellipsizedForNDK = false;
|
||||
};
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
|
@ -1061,6 +1061,14 @@ void OH_Drawing_SetTypographyTextEllipsisModal(OH_Drawing_TypographyStyle* style
|
||||
#else
|
||||
ConvertToOriginalText<TypographyStyle>(style)->ellipsisModal = rosenEllipsisModal;
|
||||
#endif
|
||||
if (!ConvertToOriginalText<TypographyStyle>(style)->ellipsizedForNDK) {
|
||||
#ifndef USE_GRAPHIC_TEXT_GINE
|
||||
ConvertToOriginalText<TypographyStyle>(style)->ellipsis_ = TypographyStyle::ELLIPSIS;
|
||||
#else
|
||||
ConvertToOriginalText<TypographyStyle>(style)->ellipsis = TypographyStyle::ELLIPSIS;
|
||||
#endif
|
||||
ConvertToOriginalText<TypographyStyle>(style)->ellipsizedForNDK = true;
|
||||
}
|
||||
}
|
||||
|
||||
double OH_Drawing_TypographyGetLineHeight(OH_Drawing_Typography* typography, int lineNumber)
|
||||
@ -1813,6 +1821,7 @@ void OH_Drawing_SetTypographyTextEllipsis(OH_Drawing_TypographyStyle* style, con
|
||||
#else
|
||||
ConvertToOriginalText<TypographyStyle>(style)->ellipsis = u16Ellipsis;
|
||||
#endif
|
||||
ConvertToOriginalText<TypographyStyle>(style)->ellipsizedForNDK = true;
|
||||
}
|
||||
|
||||
void OH_Drawing_TextStyleSetBackgroundRect(OH_Drawing_TextStyle* style, const OH_Drawing_RectStyle_Info* rectStyleInfo,
|
||||
|
@ -33,6 +33,7 @@ namespace TextEngine {
|
||||
* including parameters for default TextStyle, multi-text, and line style.
|
||||
*/
|
||||
struct TypographyStyle {
|
||||
const static inline std::u16string ELLIPSIS = u"\u2026";
|
||||
// default TextStyle
|
||||
FontWeight fontWeight = FontWeight::W400;
|
||||
FontStyle fontStyle = FontStyle::NORMAL;
|
||||
@ -77,6 +78,7 @@ struct TypographyStyle {
|
||||
* @brief Returns the default TextStyle.
|
||||
*/
|
||||
TextStyle ConvertToTextStyle() const;
|
||||
bool ellipsizedForNDK = false;
|
||||
};
|
||||
} // namespace TextEngine
|
||||
} // namespace Rosen
|
||||
|
Loading…
Reference in New Issue
Block a user