From 4b677e727ee70de6402443fa136c946097d092e2 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Sat, 31 Mar 2018 00:02:30 +0800 Subject: [PATCH] update Text remove function Text::setWrappingEnable --- core/Node/Text.cpp | 10 +--------- core/enodes.h | 7 +------ 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/core/Node/Text.cpp b/core/Node/Text.cpp index bb9edbf2..5515b3a0 100644 --- a/core/Node/Text.cpp +++ b/core/Node/Text.cpp @@ -145,20 +145,12 @@ void e2d::Text::setItalic(bool value) _reset(); } -void e2d::Text::setWrappingEnable(bool bWrappingEnable) -{ - if (m_bWrappingEnable != bWrappingEnable) - { - m_bWrappingEnable = bWrappingEnable; - _reset(); - } -} - void e2d::Text::setWrappingWidth(double fWrappingWidth) { if (m_fWrappingWidth != fWrappingWidth) { m_fWrappingWidth = max(static_cast(fWrappingWidth), 0); + m_bWrappingEnable = (m_fWrappingWidth > FLT_MIN); _reset(); } } diff --git a/core/enodes.h b/core/enodes.h index 5308bc99..da901cf6 100644 --- a/core/enodes.h +++ b/core/enodes.h @@ -580,12 +580,7 @@ public: bool value ); - // 设置文本自动换行(根据 WrappingWidth 进行自动换行,默认为 false) - void setWrappingEnable( - bool bWrappingEnable - ); - - // 设置文本换行宽度(WrappingEnable 开启时生效,默认为 0) + // 设置文本自动换行的宽度(设置为 0 时关闭自动换行,默认为 0) void setWrappingWidth( double fWrappingWidth );