diff options
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index a6212ab1f..50d4962fb 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -639,6 +639,18 @@ void Editor::RedrawSelMargin(int line, bool allAfter) { if (line != -1) { int position = pdoc->LineStart(line); PRectangle rcLine = RectangleFromRange(position, position); + + // Inflate line rectangle if there are image markers with height larger than line height + if (vs.largestMarkerHeight > vs.lineHeight) { + int delta = (vs.largestMarkerHeight - vs.lineHeight + 1) / 2; + rcLine.top -= delta; + rcLine.bottom += delta; + if (rcLine.top < rcSelMargin.top) + rcLine.top = rcSelMargin.top; + if (rcLine.bottom > rcSelMargin.bottom) + rcLine.bottom = rcSelMargin.bottom; + } + rcSelMargin.top = rcLine.top; if (!allAfter) rcSelMargin.bottom = rcLine.bottom; @@ -8040,8 +8052,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { // Marker definition and setting case SCI_MARKERDEFINE: - if (wParam <= MARKER_MAX) + if (wParam <= MARKER_MAX) { vs.markers[wParam].markType = lParam; + vs.CalcLargestMarkerHeight(); + } InvalidateStyleData(); RedrawSelMargin(); break; @@ -8112,6 +8126,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_MARKERDEFINEPIXMAP: if (wParam <= MARKER_MAX) { vs.markers[wParam].SetXPM(CharPtrFromSPtr(lParam)); + vs.CalcLargestMarkerHeight(); }; InvalidateStyleData(); RedrawSelMargin(); @@ -8128,6 +8143,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_MARKERDEFINERGBAIMAGE: if (wParam <= MARKER_MAX) { vs.markers[wParam].SetRGBAImage(sizeRGBAImage, reinterpret_cast<unsigned char *>(lParam)); + vs.CalcLargestMarkerHeight(); }; InvalidateStyleData(); RedrawSelMargin(); |