aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorMarko Njezic <devnull@localhost>2012-02-25 00:02:40 +0100
committerMarko Njezic <devnull@localhost>2012-02-25 00:02:40 +0100
commitc8ef39998a48b5e6d19eb74026b25432814d4ee3 (patch)
tree35ed2b2e95b00e25d298564cbbe13ddadde3861e /src/Editor.cxx
parent054af99d9aae10ae2222c76557e8554dafff60a5 (diff)
downloadscintilla-mirror-c8ef39998a48b5e6d19eb74026b25432814d4ee3.tar.gz
Bug #3493503. Properly redraw image markers with height larger than line height.
Regression from change set 3949.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx18
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();