mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
add constraints for map
Signed-off-by: xpeng <pengxin33@huawei.com> Change-Id: Ib4cb5015022812e99726b8939b144aeedde8cb9b
This commit is contained in:
@@ -413,6 +413,9 @@ SensorRotation ScreenRotationController::CalcSensorRotation(int sensorDegree)
|
||||
|
||||
DeviceRotation ScreenRotationController::ConvertSensorToDeviceRotation(SensorRotation sensorRotation)
|
||||
{
|
||||
if (sensorToDeviceRotationMap_.empty()) {
|
||||
ProcessRotationMapping();
|
||||
}
|
||||
return sensorToDeviceRotationMap_.at(sensorRotation);
|
||||
}
|
||||
|
||||
@@ -421,6 +424,9 @@ Rotation ScreenRotationController::ConvertDeviceToDisplayRotation(DeviceRotation
|
||||
if (deviceRotation == DeviceRotation::INVALID) {
|
||||
return GetCurrentDisplayRotation();
|
||||
}
|
||||
if (deviceToDisplayRotationMap_.empty()) {
|
||||
ProcessRotationMapping();
|
||||
}
|
||||
return deviceToDisplayRotationMap_.at(deviceRotation);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user