Added a few more helper functions for Logical to Device conversion

This commit is contained in:
Paolo Cignoni 2013-12-16 16:21:05 +00:00
parent ad2cb4678a
commit 4b8673b60b
1 changed files with 8 additions and 0 deletions

View File

@ -35,4 +35,12 @@ inline ValueType QTDeviceToLogical( QPainter *qp, const ValueType &value)
#endif #endif
} }
inline vcg::Point2f QTLogicalToOpenGL( QWidget *qw, const QPoint &p)
{
return vcg::Point2f(QTLogicalToDevice(qw,p.x()), QTLogicalToDevice(qw,qw->height()-p.y()));
}
inline int QTDeviceHeight(QWidget *qw) {return QTLogicalToDevice(qw,qw->height());}
inline int QTDeviceWidth(QWidget *qw) {return QTLogicalToDevice(qw,qw->width());}
#endif // DEVICE_TO_LOGICAL_H #endif // DEVICE_TO_LOGICAL_H