Add wxBitmapBundle::GetPreferredLogicalSizeFor()

We often need the logical bitmap size when using it in size computations
involving window size, so add a function returning it directly to
wxBitmapBundle, similarly to wxBitmap::GetLogicalSize(), to avoid using
FromPhys() everywhere.

Also rename the existing wxBitmapBundle::GetPreferredSizeFor() to
GetPreferredBitmapSizeFor() to make it more clear that this is similar
to wxBitmap::GetSize() and so returns the size in physical units.

Closes #22056.
This commit is contained in:
Alexander Koshelev
2022-01-25 12:10:07 +03:00
committed by Vadim Zeitlin
parent dd185a0b27
commit b2629a97e5
20 changed files with 82 additions and 57 deletions

View File

@@ -176,6 +176,9 @@ use "Logical", "Physical" or "DIP" in their names, the only exceptions are:
wxBitmap::GetLogicalHeight() and wxBitmap::GetLogicalSize() to use or get the
size in logical pixels which must be used in any computations involving the
sizes expressed in logical units.
- Similarly, the size returned by wxBitmapBundle::GetPreferredBitmapSizeFor()
is in physical pixels, but wxBitmapBundle::GetPreferredLogicalSizeFor() can
be used to retrieve the same value in logical units.
- The default size of wxBitmapBundle, taken by wxBitmapBundle::FromSVG() and
returned by wxBitmapBundle::GetDefaultSize() is in DIPs.