aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-11-05 19:57:03 +1100
committernyamatongwe <devnull@localhost>2011-11-05 19:57:03 +1100
commite81466ac62bb314f4952b266af77a37657a622b0 (patch)
treeaf2badd50903505b42f842e338a49b9275db564f
parent4e8aa7c5441e7b70b8beb519298dba7ed5f44dd4 (diff)
downloadscintilla-mirror-e81466ac62bb314f4952b266af77a37657a622b0.tar.gz
Fix failure to draw Polygons. Bug #3433558.
Was interpreting floating point values as integers.
-rw-r--r--win32/PlatWin.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 01c36199b..c6d8df771 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -683,7 +683,12 @@ void SurfaceGDI::LineTo(int x_, int y_) {
void SurfaceGDI::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) {
PenColour(fore);
BrushColor(back);
- ::Polygon(hdc, reinterpret_cast<POINT *>(pts), npts);
+ std::vector<POINT> outline;
+ for (int i=0;i<npts;i++) {
+ POINT pt = {pts[i].x, pts[i].y};
+ outline.push_back(pt);
+ }
+ ::Polygon(hdc, &outline[0], npts);
}
void SurfaceGDI::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) {