diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index bb8b8da564..550fc9c6d1 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -324,14 +324,14 @@ int wxBitmapRefData::GetDepth() const else return 32; // a bitmap converted from an nsimage would have this depth } + int wxBitmapRefData::GetBytesPerRow() const { wxCHECK_MSG( IsOk() , 0 , "Invalid Bitmap"); - if ( m_hBitmap ) - return (int) CGBitmapContextGetBytesPerRow(m_hBitmap); - else - return (int) GetBestBytesPerRow( GetWidth() * 4); + // Row stride length makes sense only for a bitmap representation + EnsureBitmapExists(); + return (int) CGBitmapContextGetBytesPerRow(m_hBitmap); } bool wxBitmapRefData::HasAlpha() const