X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b0c1857ea25058974e5a0dce2ef8cf5d9fbd6ac4..06a32e049c1bad9249079ad2e91659303424a774:/src/stc/PlatWX.cpp?ds=inline diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index f1f180a762..af67c0cdaa 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -277,7 +277,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 +344,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; y