diff options
author | nyamatongwe <nyamatongwe@gmail.com> | 2012-07-21 16:57:24 +1000 |
---|---|---|
committer | nyamatongwe <nyamatongwe@gmail.com> | 2012-07-21 16:57:24 +1000 |
commit | 543346f2f1de2761d801b029bb8c658533aa9950 (patch) | |
tree | 707bb85611a56d1b775c1ab88655799932a394cb /src/LineMarker.cxx | |
parent | b8dbea549073db7d6fe9c3c5c738ee894ef768cc (diff) | |
download | scintilla-mirror-543346f2f1de2761d801b029bb8c658533aa9950.tar.gz |
Scale factor implemented for RGBAImages to allow for high definition markers on retina displays.
Diffstat (limited to 'src/LineMarker.cxx')
-rw-r--r-- | src/LineMarker.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 99e83265e..9b7f1cddc 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -32,9 +32,9 @@ void LineMarker::SetXPM(const char *const *linesForm) { markType = SC_MARK_PIXMAP; } -void LineMarker::SetRGBAImage(Point sizeRGBAImage, const unsigned char *pixelsRGBAImage) { +void LineMarker::SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage) { delete image; - image = new RGBAImage(sizeRGBAImage.x, sizeRGBAImage.y, pixelsRGBAImage); + image = new RGBAImage(sizeRGBAImage.x, sizeRGBAImage.y, scale, pixelsRGBAImage); markType = SC_MARK_RGBAIMAGE; } @@ -99,10 +99,10 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac if ((markType == SC_MARK_RGBAIMAGE) && (image)) { // 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(); + rcImage.top = static_cast<int>(((rcWhole.top + rcWhole.bottom) - image->GetScaledHeight()) / 2); + rcImage.bottom = rcImage.top + image->GetScaledHeight(); + rcImage.left = static_cast<int>(((rcWhole.left + rcWhole.right) - image->GetScaledWidth()) / 2); + rcImage.right = rcImage.left + image->GetScaledWidth(); surface->DrawRGBAImage(rcImage, image->GetWidth(), image->GetHeight(), image->Pixels()); return; } |