From 9774d92e914d39095a9e0b1e8d8d7a147df7275a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 6 Mar 2018 16:01:45 +0100 Subject: [PATCH] Change wxSize::Scale() to take double, not float There doesn't seem to be any reason to use float here when double is used everywhere else. Moreover, the (implicit) conversion of int to float is not always lossless, and resulted in -Wconversion warnings from g++ 7, which disappear when using doubles. --- include/wx/gdicmn.h | 2 +- interface/wx/gdicmn.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 14b648b092..10baa55178 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -318,7 +318,7 @@ public: void DecBy(int d) { DecBy(d, d); } - wxSize& Scale(float xscale, float yscale) + wxSize& Scale(double xscale, double yscale) { x = (int)(x*xscale); y = (int)(y*yscale); return *this; } // accessors diff --git a/interface/wx/gdicmn.h b/interface/wx/gdicmn.h index 5d18c2aa7a..6e98d29d88 100644 --- a/interface/wx/gdicmn.h +++ b/interface/wx/gdicmn.h @@ -1014,7 +1014,7 @@ public: @return A reference to this object (so that you can concatenate other operations in the same line). */ - wxSize& Scale(float xscale, float yscale); + wxSize& Scale(double xscale, double yscale); /** Sets the width and height members.