Force minimum AnnotationObjectRect size

So that it's easier to select thin horizontal/vertical lines
remotes/origin/KDE/4.10
Fabio D'Urso 13 years ago
parent b6f201147c
commit 3656d8ea47
  1. 10
      core/area.cpp

@ -370,7 +370,15 @@ Annotation *AnnotationObjectRect::annotation() const
QRect AnnotationObjectRect::boundingRect( double xScale, double yScale ) const
{
return AnnotationUtils::annotationGeometry( m_annotation, xScale, yScale );
const QRect annotRect = AnnotationUtils::annotationGeometry( m_annotation, xScale, yScale );
const QPoint center = annotRect.center();
// Make sure that the rectangle has a minimum size, so that it's possible
// to click on it
const int minSize = 14;
const QRect minRect( center.x()-minSize/2, center.y()-minSize/2, minSize, minSize );
return annotRect | minRect;
}
bool AnnotationObjectRect::contains( double x, double y, double xScale, double yScale ) const

Loading…
Cancel
Save