mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-27 09:12:41 +00:00
!40102 修复cj_frontend backgroundImagePosition 不同单位效果一致问题。
Merge pull request !40102 from yuzhuohao/fix_cj_frontend_backgroundImagePostion
This commit is contained in:
commit
1dc504c431
@ -19,6 +19,7 @@
|
||||
|
||||
#include "cj_lambda.h"
|
||||
#include "bridge/cj_frontend/interfaces/cj_ffi/matrix4/cj_matrix4_ffi.h"
|
||||
#include "bridge/cj_frontend/interfaces/cj_ffi/cj_pixel_unit_convert_ffi.h"
|
||||
#include "bridge/common/utils/utils.h"
|
||||
#include "core/common/container.h"
|
||||
#include "core/components/theme/theme_manager.h"
|
||||
@ -592,13 +593,19 @@ void FfiOHOSAceFrameworkViewAbstractSetBackgroundImagePositionXY(double x, int32
|
||||
|
||||
DimensionUnit typeX = xDime.Unit();
|
||||
DimensionUnit typeY = yDime.Unit();
|
||||
double valueX = xDime.Value();
|
||||
double valueY = yDime.Value();
|
||||
double valueX = xDime.ConvertToPx();
|
||||
double valueY = yDime.ConvertToPx();
|
||||
if (xDime.Unit() == DimensionUnit::LPX) {
|
||||
valueX = FfiOHOSAceFrameworkLpx2Px(xDime.Value());
|
||||
}
|
||||
if (yDime.Unit() == DimensionUnit::LPX) {
|
||||
valueY = FfiOHOSAceFrameworkLpx2Px(yDime.Value());
|
||||
}
|
||||
if (xDime.Unit() == DimensionUnit::PERCENT) {
|
||||
valueX = xDime.Value() * FULL_DIMENSION;
|
||||
valueX = xDime.Value();
|
||||
}
|
||||
if (yDime.Unit() == DimensionUnit::PERCENT) {
|
||||
valueY = yDime.Value() * FULL_DIMENSION;
|
||||
valueY = yDime.Value();
|
||||
}
|
||||
UpdateBackgroundImagePosition(typeX, typeY, valueX, valueY, bgImgPosition);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user