aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-02-29 21:37:50 +1100
committernyamatongwe <devnull@localhost>2012-02-29 21:37:50 +1100
commit50bab1cc760155a45188c8c25e89eff62702348f (patch)
tree82543720abaa685c704e5b254e64d64ba1a182d5 /src
parent423c8008eba2845a79d22b8f34c0dfb251afc13b (diff)
downloadscintilla-mirror-50bab1cc760155a45188c8c25e89eff62702348f.tar.gz
Centre RGBA markers in all cases including when larger than allocation. Bug #3494184.
Diffstat (limited to 'src')
-rw-r--r--src/LineMarker.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index e10e69142..267ea18f4 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -97,7 +97,13 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
return;
}
if ((markType == SC_MARK_RGBAIMAGE) && (image)) {
- surface->DrawRGBAImage(rcWhole, image->GetWidth(), image->GetHeight(), image->Pixels());
+ // Make rectangle just large enough to fit image centred on centre of rcWhole
+ PRectangle rcImage;
+ rcImage.top = static_cast<int>(((rcWhole.top + rcWhole.bottom) - image->GetHeight()) / 2);
+ rcImage.bottom = rcImage.top + image->GetHeight();
+ rcImage.left = static_cast<int>(((rcWhole.left + rcWhole.right) - image->GetWidth()) / 2);
+ rcImage.right = rcImage.left + image->GetWidth();
+ surface->DrawRGBAImage(rcImage, image->GetWidth(), image->GetHeight(), image->Pixels());
return;
}
// Restrict most shapes a bit