MCPcopy Create free account
hub / github.com/KDE/kdiff3 / convertToLine

Method convertToLine

src/mergeresultwindow.cpp:1718–1730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1716}
1717
1718LineRef MergeResultWindow::convertToLine(qint32 y)
1719{
1720 const QFontMetrics& fm = fontMetrics();
1721 const qint32 fontHeight = fm.lineSpacing();
1722 constexpr qint32 topLineYOffset = 0;
1723
1724 qint32 yOffset = topLineYOffset - m_firstLine * fontHeight;
1725 if(yOffset > y)
1726 return LineRef::invalid;
1727
1728 const LineRef line = std::min((y - yOffset) / fontHeight, m_nofLines - 1);
1729 return line;
1730}
1731
1732void MergeResultWindow::mousePressEvent(QMouseEvent* e)
1733{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected