diff options
-rw-r--r-- | src/Geometry.h | 6 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/Geometry.h b/src/Geometry.h index b4d10f496..bf8f4096e 100644 --- a/src/Geometry.h +++ b/src/Geometry.h @@ -179,10 +179,14 @@ public: return ColourAlpha(co_ | (0xffu << 24)); } - constexpr ColourAlpha Opaque() const noexcept { + constexpr ColourAlpha WithoutAlpha() const noexcept { return ColourAlpha(co & 0xffffff); } + constexpr ColourAlpha Opaque() const noexcept { + return ColourAlpha(co | (0xffu << 24)); + } + constexpr int OpaqueRGB() const noexcept { return co & 0xffffff; } diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index feb7b6321..f56b14f8f 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -704,8 +704,8 @@ void SurfaceGDI::PolyLine(const Point *pts, size_t npts, Stroke stroke) { } void SurfaceGDI::Polygon(const Point *pts, size_t npts, FillStroke fillStroke) { - PenColour(fillStroke.stroke.colour.Opaque(), fillStroke.stroke.width); - BrushColour(fillStroke.fill.colour.Opaque()); + PenColour(fillStroke.stroke.colour.WithoutAlpha(), fillStroke.stroke.width); + BrushColour(fillStroke.fill.colour.WithoutAlpha()); std::vector<POINT> outline; std::transform(pts, pts + npts, std::back_inserter(outline), POINTFromPoint); ::Polygon(hdc, outline.data(), static_cast<int>(npts)); |