explain why we only consider integers right now

This commit is contained in:
Marco Martin 2014-02-25 19:39:12 +01:00
parent a04a87bcec
commit 53b2aba558
3 changed files with 6 additions and 0 deletions

View File

@ -271,6 +271,8 @@ void FrameSvgItem::componentComplete()
void FrameSvgItem::updateDevicePixelRatio()
{
//devicepixelratio is always set integer in the svg, so needs at least 192dpi to double up.
//(it needs to be integer to have lines contained inside a svg piece to keep being pixel aligned)
m_frameSvg->setDevicePixelRatio(qMax((qreal)1.0, floor(m_units.devicePixelRatio())));
}

View File

@ -187,6 +187,8 @@ qreal SvgItem::implicitHeight() const
void SvgItem::updateDevicePixelRatio()
{
if (m_svg) {
//devicepixelratio is always set integer in the svg, so needs at least 192dpi to double up.
//(it needs to be integer to have lines contained inside a svg piece to keep being pixel aligned)
m_svg.data()->setDevicePixelRatio(qMax((qreal)1.0, floor(m_units.devicePixelRatio())));
}
}

View File

@ -663,6 +663,8 @@ Svg::~Svg()
void Svg::setDevicePixelRatio(qreal ratio)
{
//be completely integer for now
//devicepixelratio is always set integer in the svg, so needs at least 192dpi to double up.
//(it needs to be integer to have lines contained inside a svg piece to keep being pixel aligned)
if (floor(d->devicePixelRatio) == floor(ratio)) {
return;
}