!16984 修复编译优化文字不对齐问题

Merge pull request !16984 from nobody2020/master
This commit is contained in:
openharmony_ci 2024-11-14 02:48:45 +00:00 committed by Gitee
commit 157a3d1962
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -172,7 +172,7 @@ bool BootCompileProgress::RegisterVsyncCallback()
bool BootCompileProgress::WaitBmsStartIfNeeded()
{
if (WaitParameter(BMS_COMPILE_STATUS, BMS_COMPILE_STATUS_BEGIN.c_str(), WAITING_BMS_TIMEOUT)) {
if (WaitParameter(BMS_COMPILE_STATUS, BMS_COMPILE_STATUS_BEGIN.c_str(), WAITING_BMS_TIMEOUT) != 0) {
LOGE("waiting bms start oat compile failed.");
return false;
}
@ -215,13 +215,14 @@ void BootCompileProgress::DrawCompileProgress()
LOGE("textBound is null");
return;
}
Rosen::Drawing::Brush whiteBrush;
whiteBrush.SetColor(0xFFFFFFFF);
whiteBrush.SetAntiAlias(true);
canvas->AttachBrush(whiteBrush);
double scale = 0.5;
float scalarX = windowWidth_ * scale - textBlob->Bounds()->GetWidth() / NUMBER_TWO;
auto textWidth = font.MeasureText(info, strlen(info), Rosen::Drawing::TextEncoding::UTF8, nullptr);
float scalarX = windowWidth_ / NUMBER_TWO - textWidth / NUMBER_TWO;
float scalarY = TEXT_BLOB_OFFSET + textBound->GetHeight() / NUMBER_TWO;
canvas->DrawTextBlob(textBlob.get(), scalarX, scalarY);
canvas->DetachBrush();