[Differential] [Changed Subscribers] D3188: Modified distance function to keep aspect ratio as close as possible

mart (Marco Martin) noreply at phabricator.kde.org
Fri Oct 28 14:24:23 UTC 2016


mart added inline comments.

INLINE COMMENTS

> image.cpp:186
>  
> -    //qDebug() << "wanted" << m_targetSize << "options" << images;
> -
> -    // choose the nearest resolution, always preferring images with the same aspect ratio
> +    //float targetAspectRatio = (m_targetSize.height() > 0 ) ? m_targetSize.width() / (float)m_targetSize.height() : 0;
> +    //qDebug() << "wanted" << m_targetSize << "options" << images << "aspect ratio" << targetAspectRatio;

remove dead code

> image.cpp:196
>          }
> -        float candidateAspectRatio = candidate.width()/(float)candidate.height();
> +        //float candidateAspectRatio = (candidate.height() > 0 ) ? candidate.width() / (float)candidate.height() : FLT_MAX;
>  

dead code

> testfindpreferredimage.cpp:90
> +	total++;
> +	if (preferred != expected) failed++;
> +	std::cout << "For a screen size of " << qPrintable(formatResolution(resolution))

good that a test has been added!
but instead of doing all of this manually, couldn't it use qt autotest stuff, qcompare, qtest etc?

REPOSITORY
  rPLASMAWORKSPACE Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D3188

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: antlarr, #plasma
Cc: mart, plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161028/e3fe30e8/attachment.html>


More information about the Plasma-devel mailing list