Merge branch 'stc-dip' of https://github.com/MaartenBent/wxWidgets
Use correct wxBitmap size for STC. See #22465.
This commit is contained in:
@@ -76,7 +76,7 @@ public:
|
||||
bool HasAlpha() const;
|
||||
WXImage GetImage() const;
|
||||
|
||||
void SetScaleFactor(double scale) { m_scaleFactor = scale; }
|
||||
void SetScaleFactor(double scale);
|
||||
double GetScaleFactor() const { return m_scaleFactor; }
|
||||
|
||||
const void *GetRawAccess() const;
|
||||
@@ -369,6 +369,18 @@ WXImage wxBitmapRefData::GetImage() const
|
||||
return m_nsImage;
|
||||
}
|
||||
|
||||
void wxBitmapRefData::SetScaleFactor( double scale )
|
||||
{
|
||||
wxCHECK_RET( IsOk() , wxT("invalid bitmap") ) ;
|
||||
|
||||
if ( m_scaleFactor == scale )
|
||||
return ;
|
||||
|
||||
CGContextScaleCTM( m_hBitmap, 1 / GetScaleFactor(), -1 / GetScaleFactor() );
|
||||
m_scaleFactor = scale;
|
||||
CGContextScaleCTM( m_hBitmap, GetScaleFactor(), -GetScaleFactor() );
|
||||
}
|
||||
|
||||
void wxBitmapRefData::UseAlpha( bool use )
|
||||
{
|
||||
wxCHECK_RET( IsOk() , wxT("invalid bitmap") ) ;
|
||||
|
||||
@@ -293,13 +293,12 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface *surface, WindowID w
|
||||
wxMemoryDC* mdc = surface
|
||||
? new wxMemoryDC(static_cast<SurfaceImpl*>(surface)->hdc)
|
||||
: new wxMemoryDC();
|
||||
mdc->GetImpl()->SetWindow(GETWIN(winid));
|
||||
hdc = mdc;
|
||||
hdcOwned = true;
|
||||
if (width < 1) width = 1;
|
||||
if (height < 1) height = 1;
|
||||
bitmap = new wxBitmap();
|
||||
bitmap->CreateWithDIPSize(width, height,(GETWIN(winid))->GetDPIScaleFactor());
|
||||
bitmap = new wxBitmap(GETWIN(winid)->ToPhys(wxSize(width, height)));
|
||||
bitmap->SetScaleFactor(GETWIN(winid)->GetDPIScaleFactor());
|
||||
mdc->SelectObject(*bitmap);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user