FIX: get suitable font size to draw the texts

jira: [STUDIO-10067]
Change-Id: I589fd6a271ae177e4630e403b64c18090aab9471
(cherry picked from commit d036c92a3793e8c0c758432b52f2af8ffeff751f)
This commit is contained in:
xin.zhang
2025-02-19 18:25:14 +08:00
committed by Noisyfox
parent 3dd369ad4e
commit c077d8e4d0
5 changed files with 61 additions and 15 deletions

View File

@@ -1029,6 +1029,7 @@ PinCodePanel::PinCodePanel(wxWindow* parent, int type, wxWindowID winid /*= wxID
if (m_type == 0) {txt = _L("Bind with Pin Code");}
else if (m_type == 1) {txt = _L("Bind with Access Code");}
WxFontUtils::get_suitable_font_size(0.5 * size.GetHeight(), dc);
auto txt_size = dc.GetTextExtent(txt);
dc.DrawText(txt, wxPoint(FromDIP(28), (size.y - txt_size.y) / 2));