diff --git a/frameworks/components/ui_box_progress.cpp b/frameworks/components/ui_box_progress.cpp index 506e7990f6be7f8952e9b063e6b808285e094b18..48232b0605f7964db43b881723e7b2e76c2c3e60 100755 --- a/frameworks/components/ui_box_progress.cpp +++ b/frameworks/components/ui_box_progress.cpp @@ -127,7 +127,16 @@ void UIBoxProgress::DrawRoundCap(BufferInfo& gfxDstBuffer, arcInfo.imgPos = imgPos; arcInfo.imgSrc = image; - if (rect.GetWidth() % 2 == 0) { // 2: determine the odd or even number of the width + bool isEvenLen = false; + if (direction_ == Direction::DIR_LEFT_TO_RIGHT || direction_ == Direction::DIR_RIGHT_TO_LEFT) { + if (rect.GetHeight() % 2 == 0) { // 2: determine the odd or even number of the height + isEvenLen = true; + } + } else if (rect.GetWidth() % 2 == 0) { // 2: determine the odd or even number of the width + isEvenLen = true; + } + + if (isEvenLen) { arcInfo.center = leftTop; arcInfo.startAngle = THREE_QUARTER_IN_DEGREE; arcInfo.endAngle = 0; diff --git a/test/uitest/test_progress_bar/ui_test_box_progress.cpp b/test/uitest/test_progress_bar/ui_test_box_progress.cpp index aea51d6f77714d29ca2eff9f58340c3097eba735..28f6fcf06ba3f4fe305eb8f9a0885f16a6530b7e 100755 --- a/test/uitest/test_progress_bar/ui_test_box_progress.cpp +++ b/test/uitest/test_progress_bar/ui_test_box_progress.cpp @@ -388,8 +388,9 @@ bool UITestBoxProgress::OnClick(UIView& view, const ClickEvent& event) style.bgColor_ = Color::Blue(); boxProgress_->SetForegroundStyle(style); } else if (&view == getStyleBtn_) { - boxProgress_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); - boxProgress_->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::Yellow().full); + boxProgress_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, Color::White().full); + boxProgress_->SetBackgroundStyle(STYLE_BACKGROUND_OPA, 128); // 128: opa + boxProgress_->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full); } else if (&view == roundCapBtn_) { boxProgress_->SetCapType(CapType::CAP_ROUND); } else if (&view == noneCapBtn_) { diff --git a/test/uitest/test_slider/ui_test_slider.cpp b/test/uitest/test_slider/ui_test_slider.cpp index 6e365345dc9808c227c5e469e6f71b06260d1b3d..61b9b4bd28bd9d8fe7e4da36e502a9108f3c669b 100755 --- a/test/uitest/test_slider/ui_test_slider.cpp +++ b/test/uitest/test_slider/ui_test_slider.cpp @@ -571,7 +571,7 @@ bool UITestSlider::ExpandClick2(UIView& view, const ClickEvent& event) slider_->SetKnobWidth(0); slider_->SetBackgroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND); slider_->SetBackgroundStyle(STYLE_BACKGROUND_OPA, BACKGROUND_OPA); - slider_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); + slider_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, Color::White().full); slider_->SetForegroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND); slider_->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(FOREGROUND_COLOR_R, FOREGROUND_COLOR_G, FOREGROUND_COLOR_B).full);