Make wxRescaleCoord() safer by requiring explicitly using From/To

This should help with accidentally exchanging the order of parameters
and makes the code using this function more readable.

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-07-13 17:46:02 +01:00
parent 7843c99d5b
commit 035c29e6a2
5 changed files with 96 additions and 29 deletions

View File

@@ -187,7 +187,7 @@ wxSize wxButtonBase::GetDefaultSize(wxWindow* win)
// http://support.microsoft.com/default.aspx/kb/145994 for detailed
// discussion.
s_sizeBtn.SetAtNewDPI(wxRescaleCoord(wxSize(50, 14), base, wxSize(4, 8)));
s_sizeBtn.SetAtNewDPI(wxRescaleCoord(50, 14).From(4, 8).To(base));
}
return s_sizeBtn.Get();