Make cursor change when hovering over object.

This commit is contained in:
Jim Evins
2015-08-14 15:21:57 -04:00
parent cdbc3a8c9b
commit e5f5ddaf17
11 changed files with 82 additions and 47 deletions
+19 -2
View File
@@ -895,10 +895,27 @@ namespace glabels
///
/// Default isLocatedAt method
/// Is this object locate at x,y?
///
bool LabelModelObject::isLocatedAt( double x, double y )
bool LabelModelObject::isLocatedAt( double scale, double x, double y ) const
{
QPointF p( x, y );
p -= QPointF( mX0, mY0 ); // Translate point to x0,y0
QPainterPath objectPath = mMatrix.map( path() );
if ( objectPath.contains( p ) )
{
return true;
}
else if ( mOutline )
{
QPainterPath outlinePath = mMatrix.map( mOutline->path( scale ) );
if ( outlinePath.contains( p ) )
{
return true;
}
}
return false;
}