Implement region select capability in View.

This commit is contained in:
Jim Evins
2014-01-11 00:30:52 -05:00
parent eeb55cf846
commit e1e666fa3d
4 changed files with 192 additions and 21 deletions
+24
View File
@@ -19,3 +19,27 @@
*/
#include "LabelRegion.h"
#include <algorithm>
#include <cmath>
namespace glabels
{
QRectF LabelRegion::rect() const
{
using std::min;
using std::fabs;
QRectF r;
r.setX( min( mX1, mX2 ) );
r.setY( min( mY1, mY2 ) );
r.setWidth( fabs( mX2 - mX1 ) );
r.setHeight( fabs( mY2 - mY1 ) );
return r;
}
}