Make cursor change when hovering over handle.
This commit is contained in:
@@ -925,15 +925,18 @@ namespace glabels
|
|||||||
///
|
///
|
||||||
Handle* LabelModelObject::handleAt( double scale, double x, double y ) const
|
Handle* LabelModelObject::handleAt( double scale, double x, double y ) const
|
||||||
{
|
{
|
||||||
QPointF p( x, y );
|
if ( mSelectedFlag )
|
||||||
p -= QPointF( mX0, mY0 ); // Translate point to x0,y0
|
|
||||||
|
|
||||||
foreach ( Handle* handle, mHandles )
|
|
||||||
{
|
{
|
||||||
QPainterPath handlePath = mMatrix.map( handle->path( scale ) );
|
QPointF p( x, y );
|
||||||
if ( handlePath.contains( p ) )
|
p -= QPointF( mX0, mY0 ); // Translate point to x0,y0
|
||||||
|
|
||||||
|
foreach ( Handle* handle, mHandles )
|
||||||
{
|
{
|
||||||
return handle;
|
QPainterPath handlePath = mMatrix.map( handle->path( scale ) );
|
||||||
|
if ( handlePath.contains( p ) )
|
||||||
|
{
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -345,8 +345,12 @@ glabels::View::mouseMoveEvent( QMouseEvent* event )
|
|||||||
{
|
{
|
||||||
|
|
||||||
case IdleState:
|
case IdleState:
|
||||||
/* @TODO handle handles. */
|
if ( mModel->isSelectionAtomic() &&
|
||||||
if ( mModel->objectAt( mZoom, xWorld, yWorld ) )
|
mModel->handleAt( mZoom, xWorld, yWorld ) )
|
||||||
|
{
|
||||||
|
setCursor( Qt::CrossCursor );
|
||||||
|
}
|
||||||
|
else if ( mModel->objectAt( mZoom, xWorld, yWorld ) )
|
||||||
{
|
{
|
||||||
setCursor( Qt::SizeAllCursor );
|
setCursor( Qt::SizeAllCursor );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user