From 8d57d3a05a27a33350ca5c37fe14251b09170ff4 Mon Sep 17 00:00:00 2001 From: baoyang Date: Mon, 14 Oct 2024 13:12:19 +0000 Subject: [PATCH] cherry pick 080069d from https://gitee.com/bao_yang_300/security_security_component/pulls/205 fix log Signed-off-by: baoyang Change-Id: I34d53db146bdf785955a8b5052f3bffbd4fca4c6 --- .../sa/sa_main/sec_comp_entity.cpp | 8 ++++++-- .../sa/sa_main/sec_comp_info_helper.cpp | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/services/security_component_service/sa/sa_main/sec_comp_entity.cpp b/services/security_component_service/sa/sa_main/sec_comp_entity.cpp index 1894daa..4a98fad 100644 --- a/services/security_component_service/sa/sa_main/sec_comp_entity.cpp +++ b/services/security_component_service/sa/sa_main/sec_comp_entity.cpp @@ -68,8 +68,12 @@ int32_t SecCompEntity::CheckPointEvent(const SecCompClickEvent& clickInfo) const } if (!componentInfo_->rect_.IsInRect(clickInfo.point.touchX, clickInfo.point.touchY)) { - SC_LOG_ERROR(LABEL, "touch point is not in component rect, %{public}lf, %{public}lf", - clickInfo.point.touchX, clickInfo.point.touchY); + SC_LOG_ERROR(LABEL, "touch point is not in component rect = (%{public}f, %{public}f)" \ + "left top point of component rect = (%{public}f, %{public}f)" \ + "right bottom point of component rect = (%{public}f, %{public}f)", + clickInfo.point.touchX, clickInfo.point.touchY, componentInfo_->rect_.x_, componentInfo_->rect_.y_, + componentInfo_->rect_.x_ + componentInfo_->rect_.width_, + componentInfo_->rect_.y_ + componentInfo_->rect_.height_); return SC_SERVICE_ERROR_CLICK_EVENT_INVALID; } return SC_OK; diff --git a/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp b/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp index abe0318..245d9eb 100644 --- a/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp +++ b/services/security_component_service/sa/sa_main/sec_comp_info_helper.cpp @@ -44,7 +44,7 @@ void SecCompInfoHelper::AdjustSecCompRect(SecCompBase* comp, float scale) comp->rect_.x_ = comp->windowRect_.x_ + (comp->rect_.x_ - comp->windowRect_.x_) * scale; comp->rect_.y_ = comp->windowRect_.y_ + (comp->rect_.y_ - comp->windowRect_.y_) * scale; - SC_LOG_DEBUG(LABEL, "After adjust x %{public}lf, y %{public}lf, width %{public}lf, height %{public}lf", + SC_LOG_DEBUG(LABEL, "After adjust x %{public}f, y %{public}f, width %{public}f, height %{public}f", comp->rect_.x_, comp->rect_.y_, comp->rect_.width_, comp->rect_.height_); } @@ -213,6 +213,7 @@ bool SecCompInfoHelper::CheckComponentValid(SecCompBase* comp) } float scale = WindowInfoHelper::GetWindowScale(comp->windowId_); + SC_LOG_DEBUG(LABEL, "WindowScale = %{public}f", scale); if (!IsEqual(scale, WindowInfoHelper::FULL_SCREEN_SCALE) && !IsEqual(scale, 0.0)) { AdjustSecCompRect(comp, scale); } -- Gitee