fix mouse selection for high DPI screens

This commit is contained in:
wmayer
2019-03-14 19:51:44 +01:00
parent 2f2d505359
commit bb6e4e6ad4

View File

@@ -390,7 +390,16 @@ int PolyPickerSelection::locationEvent(const SoLocation2Event* const, const QPoi
if (polyline.isWorking()) {
// check the position
#if QT_VERSION >= 0x050000
qreal dpr = _pcView3D->getGLWidget()->devicePixelRatioF();
#else
qreal dpr = 1.0;
#endif
QRect r = _pcView3D->getGLWidget()->rect();
if (dpr != 1.0) {
r.setHeight(r.height()*dpr);
r.setWidth(r.width()*dpr);
}
if (!r.contains(clPoint)) {
if (clPoint.x() < r.left())
@@ -599,7 +608,16 @@ int FreehandSelection::locationEvent(const SoLocation2Event* const e, const QPoi
if (polyline.isWorking()) {
// check the position
#if QT_VERSION >= 0x050000
qreal dpr = _pcView3D->getGLWidget()->devicePixelRatioF();
#else
qreal dpr = 1.0;
#endif
QRect r = _pcView3D->getGLWidget()->rect();
if (dpr != 1.0) {
r.setHeight(r.height()*dpr);
r.setWidth(r.width()*dpr);
}
if (!r.contains(clPoint)) {
if (clPoint.x() < r.left())