MCPcopy Create free account
hub / github.com/KDE/okular / nearestObjectRect

Method nearestObjectRect

core/page.cpp:488–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488const ObjectRect *Page::nearestObjectRect(ObjectRect::ObjectType type, double x, double y, double xScale, double yScale, double *distance) const
489{
490 ObjectRect *res = nullptr;
491 double minDistance = std::numeric_limits<double>::max();
492
493 for (ObjectRect *rect : m_rects) {
494 if (rect->objectType() == type) {
495 double dist = rect->distanceSqr(x, y, xScale, yScale);
496 if (dist < minDistance) {
497 res = rect;
498 minDistance = dist;
499 }
500 }
501 }
502
503 if (distance) {
504 *distance = minDistance;
505 }
506 return res;
507}
508
509const PageTransition *Page::transition() const
510{

Callers 1

mouseReleaseEventMethod · 0.80

Calls 2

objectTypeMethod · 0.80
distanceSqrMethod · 0.45

Tested by

no test coverage detected