aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LineMarker.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-02-29 21:37:50 +1100
committernyamatongwe <unknown>2012-02-29 21:37:50 +1100
commit4c63182eef7ddedde4d5a445ff91be6168429599 (patch)
tree02c311a909f6228e67646937f7e21f99cd4c11b5 /src/LineMarker.cxx
parent4c4e655420931ed2200a7d7e6b729d747f666870 (diff)
downloadscintilla-mirror-4c63182eef7ddedde4d5a445ff91be6168429599.tar.gz
Centre RGBA markers in all cases including when larger than allocation. Bug #3494184.
Diffstat (limited to 'src/LineMarker.cxx')
-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