D21836: Mind the devicePixelRatio when drawing on-screen in presentation mode

Tobias Deiminger noreply at phabricator.kde.org
Thu Jun 20 11:26:04 BST 2019


tobiasdeiminger added inline comments.

INLINE COMMENTS

> presentationwidget.cpp:900
>  
> -        QPixmap pm( geom.size() );
> +        QPixmap pm( QSize( geom.size().width() * dpr, geom.size().height() * dpr ) );
>          pm.fill( Qt::transparent );

Maybe use a scoped

  const QSizeF pmSize { geom.width() * dpr, geom.height() * dpr };

instead of repeatedly recalculating width and height?

> presentationwidget.cpp:1329
>  
> -    double nX = ( (double)e->x() - (double)geom.left() ) / (double)geom.width();
> -    double nY = ( (double)e->y() - (double)geom.top() ) / (double)geom.height();
> +    QPointF mousePos = e->screenPos();
> +    double nX = ( mousePos.x() - (double)geom.left() ) / (double)geom.width();

Is this change necessary? Conversion to `double` was already there. `screenPos()` would change semantic from "relative to widget" to "relative to screen". Doesn't matter because widget is probably always full screen. But otoh the whole thing is called `PresentationWidget`, so keeping "relative to widget" seems reasonable.

REPOSITORY
  R223 Okular

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

To: sander, #okular, ngraham, tobiasdeiminger
Cc: okular-devel, fbampaloukas, joaonetto, tfella, ngraham, darcyshen, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20190620/506d3562/attachment.html>


More information about the Okular-devel mailing list