From 676334b94b561f9f58034ee8126c89e1b4eb5085 Mon Sep 17 00:00:00 2001 From: YueBiang Date: Fri, 23 Jul 2021 11:57:29 +0800 Subject: [PATCH] IssueNo:#I423M9 Description:fix scroll bar bugs Sig:graphic Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: YueBiang --- frameworks/components/root_view.cpp | 5 +++++ frameworks/components/ui_arc_scroll_bar.cpp | 5 ++--- frameworks/components/ui_list.cpp | 6 ++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/frameworks/components/root_view.cpp b/frameworks/components/root_view.cpp index 319f971..8074699 100755 --- a/frameworks/components/root_view.cpp +++ b/frameworks/components/root_view.cpp @@ -639,6 +639,11 @@ void RootView::DrawTop(UIView* view, const Rect& rect) } stackCount = 0; curView = par->GetNextSibling(); + if (enableAnimator) { + par->OnPostDraw(*dc_.mapBufferInfo, curViewRect); + } else { + par->OnPostDraw(*dc_.bufferInfo, curViewRect); + } par = par->GetParent(); } } diff --git a/frameworks/components/ui_arc_scroll_bar.cpp b/frameworks/components/ui_arc_scroll_bar.cpp index ccffef5..27a22f6 100644 --- a/frameworks/components/ui_arc_scroll_bar.cpp +++ b/frameworks/components/ui_arc_scroll_bar.cpp @@ -21,14 +21,13 @@ namespace { constexpr uint16_t START_ANGLE_IN_DEGREE = 60; constexpr uint16_t END_ANGLE_IN_DEGREE = 120; -constexpr uint16_t SCROLL_BAR_WIDTH = 4; constexpr uint16_t SCROLL_BAR_MIN_ARC = 10; } // namespace namespace OHOS { UIArcScrollBar::UIArcScrollBar() : radius_(0), - width_(SCROLL_BAR_WIDTH), + width_(0), startAngle_(START_ANGLE_IN_DEGREE), endAngle_(END_ANGLE_IN_DEGREE), center_({0, 0}) {} @@ -67,7 +66,7 @@ void UIArcScrollBar::DrawForeground(BufferInfo& gfxDstBuffer, const Rect& invali } ArcInfo arcInfo = {0}; - arcInfo.radius = radius_; + arcInfo.radius = (radius_ > 0) ? (radius_ - 1) : 0; arcInfo.center = center_; arcInfo.startAngle = MATH_MAX(startAngle, START_ANGLE_IN_DEGREE); arcInfo.endAngle = MATH_MIN(endAngle, END_ANGLE_IN_DEGREE); diff --git a/frameworks/components/ui_list.cpp b/frameworks/components/ui_list.cpp index 4ca4e37..bcc5436 100755 --- a/frameworks/components/ui_list.cpp +++ b/frameworks/components/ui_list.cpp @@ -44,7 +44,13 @@ UIList::Recycle::~Recycle() void UIList::Recycle::MesureAdapterRelativeRect() { uint16_t i = 0; + if (listView_ == nullptr) { + return; + } UIView* childHead = listView_->childrenHead_; + if (childHead == nullptr) { + return; + } uint16_t idx = childHead->GetViewIndex(); if (listView_->direction_ == VERTICAL) { int32_t height = 0; -- GitLab