Commit 5bd55414 authored by Halla Rempt's avatar Halla Rempt
Browse files

Create the image with the right pixel size depending on resolution and unit.

BUG:305255
parent df09a0fa
......@@ -196,11 +196,10 @@ void KisCustomImageWidget::createImage()
QColor qc = cmbColor->color();
qint32 width, height;
double resolution;
resolution = doubleResolution->value() / 72.0; // internal resolution is in pixels per pt
double resolution = doubleResolution->value() / 72.0; // internal resolution is in pixels per pt
width = static_cast<qint32>(0.5 + KoUnit::ptToUnit(m_width, KoUnit(KoUnit::Pixel, resolution)));
height = static_cast<qint32>(0.5 + KoUnit::ptToUnit(m_height, KoUnit(KoUnit::Pixel, resolution)));
width = static_cast<qint32>(0.5 + KoUnit::convertFromUnitToUnit(m_width, KoUnit((KoUnit::Type)cmbWidthUnit->currentIndex()), KoUnit(KoUnit::Pixel), resolution));
height = static_cast<qint32>(0.5 + KoUnit::convertFromUnitToUnit(m_height, KoUnit((KoUnit::Type)cmbHeightUnit->currentIndex()), KoUnit(KoUnit::Pixel), resolution));
qc.setAlpha(backgroundOpacity());
KoColor bgColor(qc, cs);
......
Supports Markdown
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