Fix extra background colors on printing due to Change History

Patch ref:
https://sourceforge.net/p/scintilla/bugs/2358/#a3e3

Fix #12281
This commit is contained in:
Don Ho 2022-10-11 02:24:35 +02:00
parent 49e5a17377
commit 9bec8f5460
1 changed files with 8 additions and 0 deletions

View File

@ -2769,6 +2769,14 @@ Sci::Position EditView::FormatRange(bool draw, CharacterRangeFull chrg, Rectangl
vsPrint.Refresh(*surfaceMeasure, model.pdoc->tabInChars); // Recalculate fixedColumnWidth
}
// Turn off change history marker backgrounds
constexpr unsigned int changeMarkers =
1u << static_cast<unsigned int>(MarkerOutline::HistoryRevertedToOrigin) |
1u << static_cast<unsigned int>(MarkerOutline::HistorySaved) |
1u << static_cast<unsigned int>(MarkerOutline::HistoryModified) |
1u << static_cast<unsigned int>(MarkerOutline::HistoryRevertedToModified);
vsPrint.maskInLine &= ~changeMarkers;
const Sci::Line linePrintStart = model.pdoc->SciLineFromPosition(chrg.cpMin);
Sci::Line linePrintLast = linePrintStart + (rc.bottom - rc.top) / vsPrint.lineHeight - 1;
if (linePrintLast < linePrintStart)