diff --git a/dmserver/include/abstract_display.h b/dmserver/include/abstract_display.h index 2b2971f564..301076d23c 100644 --- a/dmserver/include/abstract_display.h +++ b/dmserver/include/abstract_display.h @@ -77,8 +77,8 @@ private: ScreenId screenGroupId_ { SCREEN_ID_INVALID }; int32_t offsetX_ { 0 }; int32_t offsetY_ { 0 }; - int32_t width_ { 0 }; - int32_t height_ { 0 }; + uint32_t width_ { 0 }; + uint32_t height_ { 0 }; uint32_t refreshRate_ { 0 }; float virtualPixelRatio_ { 1.0f }; Rotation rotation_ { Rotation::ROTATION_0 }; diff --git a/dmserver/src/abstract_screen_controller.cpp b/dmserver/src/abstract_screen_controller.cpp index ea46da623f..a521a97b6d 100644 --- a/dmserver/src/abstract_screen_controller.cpp +++ b/dmserver/src/abstract_screen_controller.cpp @@ -599,9 +599,9 @@ sptr AbstractScreenController::AddAsSuccedentScreenLocked(s for (auto& child : screenGroup->GetChildren()) { WLOGD("AddAsSuccedentScreenLocked. defaultScreen rotation:%d", child->rotation_); if (child->rotation_ == Rotation::ROTATION_90 || child->rotation_ == Rotation::ROTATION_270) { - point.posX_ += child->GetActiveScreenMode()->height_; + point.posX_ += static_cast(child->GetActiveScreenMode()->height_); } else { - point.posX_ += child->GetActiveScreenMode()->width_; + point.posX_ += static_cast(child->GetActiveScreenMode()->width_); } } WLOGD("AddAsSuccedentScreenLocked. point:[%d %d]", point.posX_, point.posY_); @@ -804,7 +804,7 @@ void AbstractScreenController::UpdateScreenGroupLayout(sptr }); Point point; - int width = 0; + uint32_t width = 0; for (auto& screen : screens) { auto mode = screen->GetActiveScreenMode(); if (!mode) {