Round the value returned from wxFont::GetPixelSize() in wxOSX
It seems wrong to return height of 12 from this function when GetTextExtent() returns 12.9, so round the returned values instead of truncating them to int. This makes wxOSX more consistent with the other ports. (cherry picked from commit 9aceae8f28c642f7c75ec85a944335d985133112)
This commit is contained in:
parent
4e272ccaa6
commit
94997a44d6
@ -305,6 +305,7 @@ wxOSX:
|
||||
- Fix possible crash in menu item event handling (#23040).
|
||||
- Fix regression in text drawing when using clipping (#22629).
|
||||
- Don't round fractional point size when creating fonts (#23144).
|
||||
- Do round size returned by wxFont::GetPixelS().
|
||||
- Map wxFONTFAMILY_DEFAULT to wxFONTFAMILY_SWISS as in the other ports (#23158).
|
||||
- Generate wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK (#22833).
|
||||
- Fix wxDataViewCtrl::HitTest() (Vojtěch Bubník, #22789).
|
||||
|
@ -721,7 +721,7 @@ wxSize wxFont::GetPixelSize() const
|
||||
wxDouble width, height = 0;
|
||||
dc->GetTextExtent(wxT("g"), &width, &height, NULL, NULL);
|
||||
delete dc;
|
||||
return wxSize((int)width, (int)height);
|
||||
return wxSize(wxRound(width), wxRound(height));
|
||||
#else
|
||||
return wxFontBase::GetPixelSize();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user