Fix regression in wxMSW wxDC::SetAxisOrientation().

Don't mix signed/unsigned integers in arithmetic operations when normalizing
wxDC scale factors: variable holding GCD value should be of the same type as
variables holding devExt and logExt to avoid wrong results of /= operation
when dividend is a negative value.

Closes #16908.
This commit is contained in:
Artur Wieczorek 2015-03-19 22:42:44 +01:00 committed by Vadim Zeitlin
parent d2ddb2c7c0
commit 7a0123ea8e

View File

@ -2012,7 +2012,7 @@ void wxMSWDCImpl::RealizeScaleAndOrigin()
// In GDI anisotropic mode only devExt/logExt ratio is important
// so we can reduce the fractions to avoid large numbers
// which could cause arithmetic overflows inside Win API.
unsigned int gcd = wxGCD(abs(devExtX), abs(logExtX));
int gcd = wxGCD(abs(devExtX), abs(logExtX));
devExtX /= gcd;
logExtX /= gcd;
gcd = wxGCD(abs(devExtY), abs(logExtY));