提交 f17dc447 编写于 作者: O openharmony_ci 提交者: Gitee

!237 修复矩形进度条圆形端点显示异常问题

Merge pull request !237 from YueBiang/progress
......@@ -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;
......
......@@ -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_) {
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册