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
+9 -2
View File
@@ -30,6 +30,7 @@ namespace
{
const qreal dashSize = 1;
const double slopPixels = 2;
const double outlineWidthPixels = 1;
const QColor outlineColor1( 0, 0, 0 );
const QColor outlineColor2( 255, 255, 255 );
@@ -89,11 +90,17 @@ void glabels::Outline::draw( QPainter* painter ) const
///
/// Create Outline path
///
QPainterPath glabels::Outline::path( QPainter *painter ) const
QPainterPath glabels::Outline::path( double scale ) const
{
double s = 1 / scale;
QPainterPath path;
path.addRect( 0, 0, mOwner->w(), mOwner->h() );
path.addRect( -s*slopPixels, -s*slopPixels,
mOwner->w()+s*2*slopPixels, mOwner->h()+s*2*slopPixels );
path.closeSubpath();
path.addRect( s*slopPixels, s*slopPixels,
mOwner->w()-s*2*slopPixels, mOwner->h()-s*2*slopPixels );
return path;
}