[helm] explore how to do this

wilder-helm
Jacopo De Simoi 6 years ago
parent 944be4d93d
commit f88b9be6bb
  1. 31
      ui/pageview.cpp

@ -1824,6 +1824,16 @@ void PageView::paintEvent(QPaintEvent *pe)
pixmapPainter.drawRect( contentsRect );
}
// 5) Layer 3: links
qDebug() << "here";
for ( PageViewItem * i : qAsConst( d->visibleItems ) )
{
const QRect & r = i->croppedGeometry();
qDebug() << r;
pixmapPainter.setPen(Qt::green );
pixmapPainter.drawRect( r );
}
// finish painting and draw contents
pixmapPainter.end();
screenPainter.drawPixmap( contentsRect.left(), contentsRect.top(), doubleBuffer );
@ -1859,6 +1869,27 @@ void PageView::paintEvent(QPaintEvent *pe)
// 3b) Layer 1: give mouseAnnotation painting control
d->mouseAnnotation->routePaint( &screenPainter, contentsRect );
qDebug() << "there";
for ( PageViewItem * i : qAsConst( d->visibleItems ) )
{
const QLinkedList< const Okular::ObjectRect *> orects = i->page()->objectRects( Okular::ObjectRect::Action );
if ( !orects.isEmpty() )
{
foreach ( const Okular::ObjectRect * orect, orects ) {
QRect boundingRect = orect->boundingRect(i->page()->width(),i->page()->height());
QRect uncropped = i->uncroppedGeometry();
int pageHeight = i->page()->height();
int pageWidth = i->page()->width();
QRect actualRect;
actualRect.setTop(uncropped.top()+uncropped.height()*boundingRect.top()/pageHeight);
actualRect.setBottom(uncropped.top()+uncropped.height()*boundingRect.bottom()/pageHeight);
actualRect.setLeft(uncropped.left()+uncropped.width()*boundingRect.left()/pageWidth);
actualRect.setRight(uncropped.left()+uncropped.width()*boundingRect.right()/pageWidth);
screenPainter.setPen( Qt::green );
screenPainter.drawRect( actualRect );
}
}
}
// 4) Layer 2: overlays
if ( Okular::Settings::debugDrawBoundaries() )
{

Loading…
Cancel
Save