Commit 8d47b91d authored by Michael Reeves's avatar Michael Reeves

move range logic to ManualDiffHelpEntry

parent 620e4164
......@@ -263,6 +263,22 @@ class ManualDiffHelpEntry
}
int calcManualDiffFirstDiff3LineIdx(const Diff3LineVector& d3lv);
void getRangeForUI(const int winIdx, int *rangeLine1, int *rangeLine2) const {
if(winIdx == 1) {
*rangeLine1 = lineA1;
*rangeLine2 = lineA2;
}
if(winIdx == 2) {
*rangeLine1 = lineB1;
*rangeLine2 = lineB2;
}
if(winIdx == 3) {
*rangeLine1 = lineC1;
*rangeLine2 = lineC2;
}
}
bool isValidMove(int line1, int line2, int winIdx1, int winIdx2) const;
};
......
......@@ -997,18 +997,8 @@ void DiffTextWindowData::writeLine(
const ManualDiffHelpEntry& mdhe = *ci;
int rangeLine1 = -1;
int rangeLine2 = -1;
if(m_winIdx == 1) {
rangeLine1 = mdhe.lineA1;
rangeLine2 = mdhe.lineA2;
}
if(m_winIdx == 2) {
rangeLine1 = mdhe.lineB1;
rangeLine2 = mdhe.lineB2;
}
if(m_winIdx == 3) {
rangeLine1 = mdhe.lineC1;
rangeLine2 = mdhe.lineC2;
}
mdhe.getRangeForUI(m_winIdx, &rangeLine1, &rangeLine2);
if(rangeLine1 >= 0 && rangeLine2 >= 0 && srcLineIdx >= rangeLine1 && srcLineIdx <= rangeLine2)
{
p.fillRect(xOffset - fontWidth, yOffset, fontWidth - 1, fontHeight, m_pOptions->m_manualHelpRangeColor);
......
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