aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LineMarker.cxx
diff options
context:
space:
mode:
authorNeil Hodgson <nyamatongwe@gmail.com>2014-01-21 09:45:29 +1100
committerNeil Hodgson <nyamatongwe@gmail.com>2014-01-21 09:45:29 +1100
commit2bd8a54e0624143ee5128d1e224b1635b2c5d1f4 (patch)
tree6acd5402304cd8f9efc400d11ca32dab95d5410d /src/LineMarker.cxx
parent56d581a730cd2c5dd0959c6b3bd532c9f5ad42e2 (diff)
downloadscintilla-mirror-2bd8a54e0624143ee5128d1e224b1635b2c5d1f4.tar.gz
Added ELEMENTS macro and use it to clarify determining size of arrays.
Diffstat (limited to 'src/LineMarker.cxx')
-rw-r--r--src/LineMarker.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index cf44928b4..708e6a320 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -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;
@@ -374,8 +372,7 @@ 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;
@@ -389,8 +386,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
Point(rc.right-3, centreY+halfHeight),
Point(rc.left, centreY+halfHeight),
};
- surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
- fore, back);
+ surface->Polygon(pts, ELEMENTS(pts), fore, back);
} else { // SC_MARK_FULLRECT
surface->FillRectangle(rcWhole, back);
}