From 781aff17365fb369b849d05910049ebb9b985dda Mon Sep 17 00:00:00 2001 From: guyuanzhang Date: Fri, 10 Sep 2021 15:54:53 +0800 Subject: [PATCH] IssueNo: https://gitee.com/openharmony/graphic_ui/issues/I47IMP Description:fix analog_clock Sig:graphic Feature or Bugfix:Feature Binary Source:No Signed-off-by: guyuanzhang --- frameworks/components/ui_analog_clock.cpp | 13 +----------- interfaces/kits/components/ui_analog_clock.h | 22 -------------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/frameworks/components/ui_analog_clock.cpp b/frameworks/components/ui_analog_clock.cpp index 44562ec..0fb8aac 100755 --- a/frameworks/components/ui_analog_clock.cpp +++ b/frameworks/components/ui_analog_clock.cpp @@ -212,6 +212,7 @@ void UIAnalogClock::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea void UIAnalogClock::OnPostDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) { + UpdateClock(true); Rect current = GetOrigRect(); DrawHand(gfxDstBuffer, current, invalidatedArea, hourHand_); DrawHand(gfxDstBuffer, current, invalidatedArea, minuteHand_); @@ -221,18 +222,6 @@ void UIAnalogClock::OnPostDraw(BufferInfo& gfxDstBuffer, const Rect& invalidated UIView::OnPostDraw(gfxDstBuffer, invalidatedArea); } -void UIAnalogClock::SetPosition(int16_t x, int16_t y) -{ - UIViewGroup::SetPosition(x, y); - UpdateClock(true); -} - -void UIAnalogClock::SetPosition(int16_t x, int16_t y, int16_t width, int16_t height) -{ - UIViewGroup::SetPosition(x, y, width, height); - UpdateClock(true); -} - void UIAnalogClock::CalculateRedrawArea(const Rect& current, Hand& hand, bool clockInit) { /* diff --git a/interfaces/kits/components/ui_analog_clock.h b/interfaces/kits/components/ui_analog_clock.h index 157c00b..a7a9941 100755 --- a/interfaces/kits/components/ui_analog_clock.h +++ b/interfaces/kits/components/ui_analog_clock.h @@ -317,28 +317,6 @@ public: */ virtual void OnPostDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override; - /** - * @brief Sets the position for this analog clock. - * - * @param x Indicates the x-coordinate to set. - * @param y Indicates the y-coordinate to set. - * @since 1.0 - * @version 1.0 - */ - void SetPosition(int16_t x, int16_t y) override; - - /** - * @brief Sets the position and size for this analog clock. - * - * @param x Indicates the x-coordinate to set. - * @param y Indicates the y-coordinate to set. - * @param width Indicates the width to set. - * @param height Indicates the height to set. - * @since 1.0 - * @version 1.0 - */ - void SetPosition(int16_t x, int16_t y, int16_t width, int16_t height) override; - /** * @brief Sets the working mode for this analog clock. * -- GitLab