From c9697677f4bd8e94f5367deab540b90e60e898a5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 18 Sep 2015 13:49:49 +0200 Subject: [PATCH] Use a power of two division factor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using a power of 2 instead of power of 10 means the result of the division can be accurately represented as a floating point instead of being an approximation that could lead to rounding errors. Change-Id: I8910c06113ec6b69c60ff95d59894bfb56133186 Reviewed-by: Morten Johan Sørvig --- src/gui/painting/qpaintdevice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h index c360573e78..72a6ca4cb3 100644 --- a/src/gui/painting/qpaintdevice.h +++ b/src/gui/painting/qpaintdevice.h @@ -81,7 +81,7 @@ public: int colorCount() const { return metric(PdmNumColors); } int depth() const { return metric(PdmDepth); } - static inline qreal devicePixelRatioFScale() {return 10000000.0; } + static inline qreal devicePixelRatioFScale() { return 0x10000; } protected: QPaintDevice() Q_DECL_NOEXCEPT; virtual int metric(PaintDeviceMetric metric) const;