修改运动进度条的显示问题
authorCaisking <Casiking@zhihuishixun.com>
Thu, 21 Aug 2025 10:04:23 +0000 (18:04 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Thu, 21 Aug 2025 10:04:23 +0000 (18:04 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/training_card/src/TrainingDataView.cpp
code/sdk/middleware/services/gui/uikit/ui/frameworks/components/ui_circle_progress.cpp

index 771f8b7..8cce5fd 100644 (file)
@@ -66,7 +66,7 @@ bool TrainingDataView ::InitPage() {
   circleProgress->SetCenterPosition(235, 235);
   circleProgress->SetRadius(215);
   circleProgress->SetStartAngle(215);
-  circleProgress->SetEndAngle(505 + 100);
+  circleProgress->SetEndAngle(505);
   circleProgress->SetCapType(CAP_ROUND);
   circleProgress->SetValue(100);
 
index 6edd9b5..a17be15 100644 (file)
@@ -79,11 +79,7 @@ static void HwGetAngleRange(int16_t &start, int16_t &end)
 void UICircleProgress::GetAngleRange(int16_t& start, int16_t& end) const
 {
     GetStartEndAngle(start, end);
-#if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH
-    HwGetAngleRange(start, end);
-#else
     DrawArc::GetInstance()->GetDrawRange(start, end);
-#endif
 }
 
 void UICircleProgress::GetRedrawAngle(int16_t& start, int16_t& end) const
@@ -103,17 +99,16 @@ void UICircleProgress::GetRedrawAngle(int16_t& start, int16_t& end) const
     } else {
         end = angle + start;
     }
-#if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH
-    HwGetAngleRange(start, end);
-#else
     DrawArc::GetInstance()->GetDrawRange(start, end);
-#endif
 }
 #if ENABLE_VGU_ENGINE && CAPABILITY_HWDRAW_PATH
 void UICircleProgress::DrawForegroundGradient(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea,
         const Point& point, const uint16_t& radius, const Vector2<float>& angle)
 {
     ArcInfo arcInfo = {point, {0, 0}, radius, angle.x_, angle.y_, nullptr};
+    while (FloatLess(arcInfo.endAngle, arcInfo.startAngle)) {
+        arcInfo.endAngle += CIRCLE_IN_DEGREE;
+    }
 
     arcInfo.radius -= foregroundStyle_->lineWidth_ / 2; // 2: half
     LiteMGfxEngine::GetInstance()->SyncHwDraw();