Opened 2 years ago

Closed 2 years ago

#15720 closed enhancement (fixed)

Implicit cast warnings from wxBitmapBase should be eliminated

Reported by: ikamakj Owned by:
Priority: normal Milestone:
Component: GUI-all Version: 2.9.5
Keywords: Cc:
Blocked By: Blocking:
Patch: no


wxBitmapBase::CreateScaled() and wxBitmapBase::GetScaledSize() convert double values implicitly to ints, which may produce warnings depending on compiler settings. The overridden versions in the wxMSW implementation of wxBitmap cause no warnings because they use wxRound(). The warnings should be eliminated by making explicit casts to int. (Another question is whether rounding to nearest integer should be used also on non-MSW platforms.)

Change History (1)

comment:1 Changed 2 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [75307]) Round values in wxBitmap::CreateScaled() and GetScaledSize().

Do it for consistency with wxMSW and because rounding probably makes more
sense than truncation here.

Closes #15720.

Note: See TracTickets for help on using tickets.