From f6bcf5c70fcefdac16cee976e3b8cd86a1ff1b0a Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Tue, 3 Aug 2021 18:59:26 +0800 Subject: [PATCH] IssueNo:https://gitee.com/openharmony/graphic_ui/issues/I43LTU Description:support UILabel Rotate Sig:graphic Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- frameworks/transform.cpp | 4 ++-- interfaces/kits/gfx_utils/transform.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frameworks/transform.cpp b/frameworks/transform.cpp index fbbb70e..570a4ea 100755 --- a/frameworks/transform.cpp +++ b/frameworks/transform.cpp @@ -164,7 +164,7 @@ void TransformMap::UpdateMap() } else if (imgPoint3.x_ > COORD_MAX) { polygon_[i].x_ = COORD_MAX; } else { - polygon_[i].x_ = imgPoint3.x_; + polygon_[i].x_ = MATH_ROUND(imgPoint3.x_); } if (imgPoint3.y_ < COORD_MIN) { @@ -172,7 +172,7 @@ void TransformMap::UpdateMap() } else if (imgPoint3.y_ > COORD_MAX) { polygon_[i].y_ = COORD_MAX; } else { - polygon_[i].y_ = imgPoint3.y_; + polygon_[i].y_ = MATH_ROUND(imgPoint3.y_); } } Matrix3 translate = Matrix3::Translate(Vector2(rect_.GetX(), rect_.GetY())); diff --git a/interfaces/kits/gfx_utils/transform.h b/interfaces/kits/gfx_utils/transform.h index 28eec0d..68db785 100755 --- a/interfaces/kits/gfx_utils/transform.h +++ b/interfaces/kits/gfx_utils/transform.h @@ -154,6 +154,16 @@ public: return matrix_; } + const Vector2& GetRotatePivot() const + { + return rotatePivot_; + } + + int16_t GetRotateAngle() const + { + return angle_; + } + /** * @brief Rotates the rectangle. * @param angle Indicates the angle to rotate.