Commit 3656d8ea authored by Fabio D'Urso's avatar Fabio D'Urso

Force minimum AnnotationObjectRect size

So that it's easier to select thin horizontal/vertical lines
parent b6f20114
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment