diff options
author | Eugene Sandulenko | 2015-12-21 20:08:08 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-27 15:40:58 +0100 |
commit | 5c2f3301f0b02d080de43f06efabec117903cec2 (patch) | |
tree | e0131bbc917415ec5b627aa45ff581ff403ee062 /engines | |
parent | c1d051da65e9790330f712c9e3962e31af965851 (diff) | |
download | scummvm-rg350-5c2f3301f0b02d080de43f06efabec117903cec2.tar.gz scummvm-rg350-5c2f3301f0b02d080de43f06efabec117903cec2.tar.bz2 scummvm-rg350-5c2f3301f0b02d080de43f06efabec117903cec2.zip |
WAGE: More robust rectangle drawing
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/design.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index 0b9db3b2a2..f347c33f41 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -169,6 +169,12 @@ void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool m int16 x1 = in.readSint16BE(); int16 y2 = in.readSint16BE(); int16 x2 = in.readSint16BE(); + + if (x1 > x2) + SWAP(x1, x2); + if (y1 > y2) + SWAP(y1, y2); + Common::Rect outer(x1, y1, x2, y2); plotData pd(surface, &patterns, borderFillType); @@ -200,6 +206,12 @@ void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, b int16 y2 = in.readSint16BE(); int16 x2 = in.readSint16BE(); int16 arc = in.readSint16BE(); + + if (x1 > x2) + SWAP(x1, x2); + if (y1 > y2) + SWAP(y1, y2); + Common::Rect outer(x1, y1, x2, y2); plotData pd(surface, &patterns, borderFillType); @@ -215,7 +227,7 @@ void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, b pd.fillType = fillType; if (fillType > patterns.size()) { - warning("Transparent roundrect"); + warning("Transparent roundrect, border: %d", borderThickness); } drawFilledRoundRect(inner, arc/2, kColorBlack, drawPixel, &pd); |