X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/117f3eaaa78731c3b0dd87b96030e81bf451f921..cc4d5638c66a409e421420ed7110917755a66788:/src/stc/PlatWX.cpp diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 9e69d2fcd5..b752c39689 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -211,13 +211,14 @@ void SurfaceImpl::Init(SurfaceID hdc_, WindowID) { hdc = (wxDC*)hdc_; } -void SurfaceImpl::InitPixMap(int width, int height, Surface *WXUNUSED(surface_), WindowID) { +void SurfaceImpl::InitPixMap(int width, int height, Surface *WXUNUSED(surface_), WindowID winid) { Release(); hdc = new wxMemoryDC(); hdcOwned = true; if (width < 1) width = 1; if (height < 1) height = 1; - bitmap = new wxBitmap(width, height); + bitmap = new wxBitmap(); + bitmap->CreateScaled(width, height,wxBITMAP_SCREEN_DEPTH,((wxWindow*)winid)->GetContentScaleFactor()); ((wxMemoryDC*)hdc)->SelectObject(*bitmap); } @@ -277,7 +278,14 @@ void SurfaceImpl::LineTo(int x_, int y_) { void SurfaceImpl::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) { PenColour(fore); BrushColour(back); - hdc->DrawPolygon(npts, (wxPoint*)pts); + wxPoint *p = new wxPoint[npts]; + + for (int i=0; iDrawPolygon(npts, p); + delete [] p; } void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) { @@ -337,55 +345,60 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, int x, y; wxRect r = wxRectFromPRectangle(rc); wxBitmap bmp(r.width, r.height, 32); - wxAlphaPixelData pixData(bmp); - // Set the fill pixels - ColourDesired cdf(fill.AsLong()); - int red = cdf.GetRed(); - int green = cdf.GetGreen(); - int blue = cdf.GetBlue(); + // This block is needed to ensure that the changes done to the bitmap via + // pixel data object are committed before the bitmap is drawn. + { + wxAlphaPixelData pixData(bmp); + + // Set the fill pixels + ColourDesired cdf(fill.AsLong()); + int red = cdf.GetRed(); + int green = cdf.GetGreen(); + int blue = cdf.GetBlue(); + + wxAlphaPixelData::Iterator p(pixData); + for (y=0; yGetFaceName().mbc_str()); + wxStrlcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str(), WXSIZEOF(buf)); return buf; }