diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-09-18 13:49:49 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-09-24 23:35:11 +0000 |
commit | c9697677f4bd8e94f5367deab540b90e60e898a5 (patch) | |
tree | 2a65c5743d77f1dfa6d3a2bab682bc651764aafc /src/gui | |
parent | d72da0b4b2ee089156d1bd614523838b1635bbf5 (diff) |
Use a power of two division factor
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 <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpaintdevice.h | 2 |
1 files changed, 1 insertions, 1 deletions
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; |