提交 61241554 编写于 作者: 邓志豪 提交者: Gitee

回退 'Pull Request !247 : 246 HILOG冲突问题'

上级 5022ffeb
......@@ -16,7 +16,6 @@
#include "animator/animator_manager.h"
#include "common/task_manager.h"
#include "gfx_utils/graphic_log.h"
#include "hal_tick.h"
namespace OHOS {
......
......@@ -18,7 +18,6 @@
#include "draw/draw_label.h"
#include "engines/gfx/gfx_engine_manager.h"
#include "font/ui_font.h"
#include "gfx_utils/graphic_log.h"
#include "themes/theme_manager.h"
namespace OHOS {
......@@ -210,15 +209,4 @@ void UIArcLabel::MeasureArcTextInfo()
arcTextInfo_.direct, orientation_);
}
}
void UIArcLabel::InitArcLabelText()
{
if (arcLabelText_ == nullptr) {
arcLabelText_ = new Text();
if (arcLabelText_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new Text fail");
return;
}
}
}
} // namespace OHOS
\ No newline at end of file
......@@ -20,7 +20,6 @@
#include "draw/draw_label.h"
#include "engines/gfx/gfx_engine_manager.h"
#include "gfx_utils/file.h"
#include "gfx_utils/graphic_log.h"
#include "gfx_utils/image_info.h"
#include "gfx_utils/mem_api.h"
#include "imgdecode/cache_manager.h"
......
......@@ -17,7 +17,6 @@
#include "common/typed_text.h"
#include "draw/draw_label.h"
#include "font/ui_font.h"
#include "gfx_utils/graphic_log.h"
namespace OHOS {
UILabelButton::UILabelButton() : labelButtonText_(nullptr), offset_({ 0, 0 })
......@@ -40,18 +39,6 @@ void UILabelButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea
labelStyle_, ellipsisIndex, opa);
}
void UILabelButton::InitLabelButtonText()
{
if (labelButtonText_ == nullptr) {
labelButtonText_ = new Text();
if (labelButtonText_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new Text fail");
return;
}
labelButtonText_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
}
}
UILabelButton::~UILabelButton()
{
if (labelButtonText_ != nullptr) {
......
......@@ -17,7 +17,6 @@
#include "dock/vibrator_manager.h"
#include "draw/draw_line.h"
#include "draw/draw_rect.h"
#include "gfx_utils/graphic_log.h"
#include "themes/theme_manager.h"
namespace {
......@@ -246,17 +245,6 @@ void UIPicker::Refresh()
}
}
void UIPicker::InitTextAdapter()
{
if (textAdapter_ == nullptr) {
textAdapter_ = new TextAdapter();
if (textAdapter_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new TextAdapter fail");
return;
}
}
}
bool UIPicker::RefreshValues(int16_t start, int16_t end)
{
if (!isWidthSet_ || !isHeightSet_ || !itemsHeight_ || ((start == 0) && (end == 0))) {
......
......@@ -14,7 +14,6 @@
*/
#include "components/ui_video.h"
#include "gfx_utils/graphic_log.h"
#include "securec.h"
#ifndef VERSION_LITE
......
......@@ -548,20 +548,6 @@ Rect UIView::GetContentRect()
return contentRect;
}
void UIView::ResizeVisibleArea(int16_t x, int16_t y, int16_t width, int16_t height)
{
if (visibleRect_ == nullptr) {
visibleRect_ = new Rect();
if (visibleRect_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new Rect fail");
return;
}
}
visibleRect_->SetWidth(width);
visibleRect_->SetHeight(height);
visibleRect_->SetPosition(x, y);
}
Rect UIView::GetOrigRect() const
{
int16_t x = rect_.GetX();
......
......@@ -361,7 +361,16 @@ public:
protected:
Text* arcLabelText_;
virtual void InitArcLabelText();
virtual void InitArcLabelText()
{
if (arcLabelText_ == nullptr) {
arcLabelText_ = new Text();
if (arcLabelText_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new Text fail");
return;
}
}
}
void RefreshArcLabel();
private:
......
......@@ -37,6 +37,7 @@
#include "common/text.h"
#include "components/ui_button.h"
#include "gfx_utils/graphic_log.h"
namespace OHOS {
/**
......@@ -289,7 +290,17 @@ public:
}
protected:
virtual void InitLabelButtonText();
virtual void InitLabelButtonText()
{
if (labelButtonText_ == nullptr) {
labelButtonText_ = new Text();
if (labelButtonText_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new Text fail");
return;
}
labelButtonText_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
}
}
Text* labelButtonText_;
......
......@@ -381,7 +381,16 @@ protected:
void RefreshList();
virtual void ClearList();
virtual void Refresh();
virtual void InitTextAdapter();
virtual void InitTextAdapter()
{
if (textAdapter_ == nullptr) {
textAdapter_ = new TextAdapter();
if (textAdapter_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new TextAdapter fail");
return;
}
}
}
bool isWidthSet_ : 1;
bool isHeightSet_ : 1;
......
......@@ -49,6 +49,7 @@
#include "gfx_utils/color.h"
#include "gfx_utils/geometry2d.h"
#include "gfx_utils/graphic_buffer.h"
#include "gfx_utils/graphic_log.h"
#include "gfx_utils/heap_base.h"
#include "gfx_utils/image_info.h"
#include "gfx_utils/style.h"
......@@ -891,7 +892,19 @@ public:
* @since 1.0
* @version 1.0
*/
void ResizeVisibleArea(int16_t x, int16_t y, int16_t width, int16_t height);
void ResizeVisibleArea(int16_t x, int16_t y, int16_t width, int16_t height)
{
if (visibleRect_ == nullptr) {
visibleRect_ = new Rect();
if (visibleRect_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_GRAPHIC, "new Rect fail");
return;
}
}
visibleRect_->SetWidth(width);
visibleRect_->SetHeight(height);
visibleRect_->SetPosition(x, y);
}
/**
* @brief Sets the width for the view.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册