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:
@@ -601,6 +601,7 @@ wxGTK:
|
||||
|
||||
wxMSW:
|
||||
|
||||
- Fix regression in wxDC drawing with bottom-to-top y axis (Artur Wieczorek).
|
||||
- Fix compilation with C++Builder XE compiler (Nichka).
|
||||
- Fix best height of wxSlider with labels but without ticks (Artur Wieczorek).
|
||||
- Fix initial text value of wxSpinCtrlDouble (Laurent Poujoulat).
|
||||
|
@@ -2007,7 +2007,7 @@ void wxMSWDCImpl::RealizeScaleAndOrigin()
|
||||
// Becaue only devExtX/logExtX ratio and devExtY/logExtY ratio are counted
|
||||
// we can reduce the fractions to avoid large absolute numbers
|
||||
// and possible arithmetic overflows.
|
||||
unsigned int gcd = CalcGCD(abs(devExtX), abs(logExtX));
|
||||
int gcd = CalcGCD(abs(devExtX), abs(logExtX));
|
||||
devExtX /= gcd;
|
||||
logExtX /= gcd;
|
||||
gcd = CalcGCD(abs(devExtY), abs(logExtY));
|
||||
|
Reference in New Issue
Block a user