Made move selection work in view.

This commit is contained in:
Jim Evins
2015-08-14 16:34:40 -04:00
parent e5f5ddaf17
commit ffa0819010
5 changed files with 142 additions and 33 deletions
+21
View File
@@ -920,6 +920,27 @@ namespace glabels
}
///
/// Is one of this object's handles locate at x,y? If so, return it.
///
Handle* LabelModelObject::handleAt( double scale, double x, double y ) const
{
QPointF p( x, y );
p -= QPointF( mX0, mY0 ); // Translate point to x0,y0
foreach ( Handle* handle, mHandles )
{
QPainterPath handlePath = mMatrix.map( handle->path( scale ) );
if ( handlePath.contains( p ) )
{
return handle;
}
}
return 0;
}
///
/// Draw object + shadow
///