mirror of
https://github.com/openharmony/ace_ace_engine.git
synced 2026-07-21 09:55:23 -04:00
增加fontScale赋值时的pipelineContext判空
Signed-off-by: xiexiyun <xiexiyun@huawei.com> Change-Id: I85cfbe126105e6dc2fbe2510375602887f1f3d49
This commit is contained in:
@@ -641,7 +641,10 @@ panda::Local<panda::JSValueRef> Fp2Px(panda::EcmaVM* vm, panda::Local<panda::JSV
|
||||
return panda::JSValueRef::Undefined(vm);
|
||||
}
|
||||
auto pipelineContext = container->GetPipelineContext();
|
||||
double fontScale = pipelineContext->GetFontScale();
|
||||
double fontScale = 1.0;
|
||||
if (pipelineContext) {
|
||||
fontScale = pipelineContext->GetFontScale();
|
||||
}
|
||||
double pxValue = fpValue * density * fontScale;
|
||||
return panda::NumberRef::New(vm, pxValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user