Fix clicking on notes being hard on high zooms

It is still not perfect because for some reason poppler is painting outside the boundaries box (or we are not creating/setting it correctly)
but at least now it's not ultra hard to click in a note application at high zoom

FIXED-IN: 4.10.4
BUGS: 319637
remotes/origin/KDE/4.10
Albert Astals Cid 13 years ago
parent 6c40f3ea9a
commit c9964acdc6
  1. 10
      core/annotations.cpp

@ -92,13 +92,17 @@ QDomElement AnnotationUtils::findChildElement( const QDomNode & parentNode,
QRect AnnotationUtils::annotationGeometry( const Annotation * ann,
double scaledWidth, double scaledHeight )
{
const QRect rect = ann->transformedBoundingRectangle().geometry( (int)scaledWidth, (int)scaledHeight );
if ( ann->subType() == Annotation::AText && ( ( (TextAnnotation*)ann )->textType() == TextAnnotation::Linked ) )
{
return QRect( (int)( ann->transformedBoundingRectangle().left * scaledWidth ),
(int)( ann->transformedBoundingRectangle().top * scaledHeight ), 24, 24 );
// To be honest i have no clue of why the 24,24 is here, maybe to make sure it's not too small?
// But why only for linked text?
const QRect rect24 = QRect( (int)( ann->transformedBoundingRectangle().left * scaledWidth ),
(int)( ann->transformedBoundingRectangle().top * scaledHeight ), 24, 24 );
return rect24.united(rect);
}
return ann->transformedBoundingRectangle().geometry( (int)scaledWidth, (int)scaledHeight );
return rect;
}
//END AnnotationUtils implementation

Loading…
Cancel
Save