diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2014-01-28 08:25:46 +0200 |
---|---|---|
committer | XhmikosR <xhmikosr@users.sourceforge.net> | 2014-01-28 08:28:03 +0200 |
commit | 83a87f566bc26dbf71f640e574e24fb79362d4bf (patch) | |
tree | 219ff0c15d346a3e237836703c5eeeff51f90783 /scintilla/src/LineMarker.cxx | |
parent | a064352979725e782162c42a168e83b41a0a0190 (diff) | |
download | notepad2-mod-83a87f566bc26dbf71f640e574e24fb79362d4bf.zip notepad2-mod-83a87f566bc26dbf71f640e574e24fb79362d4bf.tar.gz notepad2-mod-83a87f566bc26dbf71f640e574e24fb79362d4bf.tar.bz2 |
Update Scintilla to 3.3.8.
Diffstat (limited to 'scintilla/src/LineMarker.cxx')
-rw-r--r-- | scintilla/src/LineMarker.cxx | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/scintilla/src/LineMarker.cxx b/scintilla/src/LineMarker.cxx index 33690ac..2a332ab 100644 --- a/scintilla/src/LineMarker.cxx +++ b/scintilla/src/LineMarker.cxx @@ -1,6 +1,6 @@ // Scintilla source code edit control
/** @file LineMarker.cxx
- ** Defines the look of a line marker in the margin .
+ ** Defines the look of a line marker in the margin.
**/
// Copyright 1998-2011 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
@@ -14,6 +14,8 @@ #include "Platform.h"
#include "Scintilla.h"
+
+#include "StringCopy.h"
#include "XPM.h"
#include "LineMarker.h"
@@ -141,8 +143,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point(centreX - dimOn4, centreY + dimOn2),
Point(centreX + dimOn2 - dimOn4, centreY),
};
- surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
- fore, back);
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
} else if (markType == SC_MARK_ARROWDOWN) {
Point pts[] = {
@@ -150,8 +151,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point(centreX + dimOn2, centreY - dimOn4),
Point(centreX, centreY + dimOn2 - dimOn4),
};
- surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
- fore, back);
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
} else if (markType == SC_MARK_PLUS) {
Point pts[] = {
@@ -168,8 +168,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point(centreX - 1, centreY + 1),
Point(centreX - armSize, centreY + 1),
};
- surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
- fore, back);
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
} else if (markType == SC_MARK_MINUS) {
Point pts[] = {
@@ -178,8 +177,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point(centreX + armSize, centreY +1),
Point(centreX - armSize, centreY + 1),
};
- surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
- fore, back);
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
} else if (markType == SC_MARK_SMALLRECT) {
PRectangle rcSmall;
@@ -317,17 +315,14 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac DrawPlus(surface, centreX, centreY, blobSize, tail);
} else if (markType == SC_MARK_CIRCLEMINUS) {
- DrawCircle(surface, centreX, centreY, blobSize, fore, head);
- DrawMinus(surface, centreX, centreY, blobSize, tail);
-
surface->PenColour(head);
surface->MoveTo(centreX, centreY + blobSize);
surface->LineTo(centreX, rcWhole.bottom);
- } else if (markType == SC_MARK_CIRCLEMINUSCONNECTED) {
DrawCircle(surface, centreX, centreY, blobSize, fore, head);
DrawMinus(surface, centreX, centreY, blobSize, tail);
+ } else if (markType == SC_MARK_CIRCLEMINUSCONNECTED) {
surface->PenColour(head);
surface->MoveTo(centreX, centreY + blobSize);
surface->LineTo(centreX, rcWhole.bottom);
@@ -336,6 +331,9 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac surface->MoveTo(centreX, rcWhole.top);
surface->LineTo(centreX, centreY - blobSize);
+ DrawCircle(surface, centreX, centreY, blobSize, fore, head);
+ DrawMinus(surface, centreX, centreY, blobSize, tail);
+
} else if (markType >= SC_MARK_CHARACTER) {
char character[1];
character[0] = static_cast<char>(markType - SC_MARK_CHARACTER);
@@ -355,10 +353,12 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac } else if (markType == SC_MARK_ARROWS) {
surface->PenColour(fore);
int right = centreX - 2;
- for (int b=0; b<3; b++) {
- surface->MoveTo(right - 4, centreY - 4);
- surface->LineTo(right, centreY);
- surface->LineTo(right - 5, centreY + 5);
+ const int armLength = dimOn2 - 1;
+ for (int b = 0; b<3; b++) {
+ surface->MoveTo(right, centreY);
+ surface->LineTo(right - armLength, centreY - armLength);
+ surface->MoveTo(right, centreY);
+ surface->LineTo(right - armLength, centreY + armLength);
right += 4;
}
} else if (markType == SC_MARK_SHORTARROW) {
@@ -372,12 +372,21 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac Point(centreX, centreY + dimOn4),
Point(centreX, centreY + dimOn2),
};
- surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
- fore, back);
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
} else if (markType == SC_MARK_LEFTRECT) {
PRectangle rcLeft = rcWhole;
rcLeft.right = rcLeft.left + 4;
surface->FillRectangle(rcLeft, back);
+ } else if (markType == SC_MARK_BOOKMARK) {
+ int halfHeight = minDim / 3;
+ Point pts[] = {
+ Point(rc.left, centreY-halfHeight),
+ Point(rc.right-3, centreY-halfHeight),
+ Point(rc.right-3-halfHeight, centreY),
+ Point(rc.right-3, centreY+halfHeight),
+ Point(rc.left, centreY+halfHeight),
+ };
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
} else { // SC_MARK_FULLRECT
surface->FillRectangle(rcWhole, back);
}
|