Commit b058b377 authored by Mathias Wein's avatar Mathias Wein
Browse files

Fix imprecise dimensions when using image size dialog

Due to the way multiple units are handled, the result can be a tiny bit
smaller then the true value of e.g. 50% of 2816 px, despite qreal precision.
Furthermore, the spinbox will round to nearest integer when you
switch back to pixels, so the final value should consistently be rounded
instead of truncated for non-pixel input units.

parent 8977dc9b
Pipeline #79517 skipped with stage
......@@ -297,12 +297,12 @@ DlgImageSize::~DlgImageSize()
qint32 DlgImageSize::desiredWidth()
return int(m_page->pixelWidthDouble->value());
return qRound(m_page->pixelWidthDouble->value());
qint32 DlgImageSize::desiredHeight()
return int(m_page->pixelHeightDouble->value());
return qRound(m_page->pixelHeightDouble->value());
double DlgImageSize::desiredResolution()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment