aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Indicator.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2020-06-10 10:51:46 +1000
committerNeil <nyamatongwe@gmail.com>2020-06-10 10:51:46 +1000
commitc6f1f1c7c7f486fd19c394a7e33df9f0980b55c8 (patch)
tree7e9ef4edb5853eccbcb2665a47657ec23584a2c5 /src/Indicator.cxx
parent4b4de8537bdc20fc858e8a6258e80181ac417fe8 (diff)
downloadscintilla-mirror-c6f1f1c7c7f486fd19c394a7e33df9f0980b55c8.tar.gz
Backport: Convert enum to enum class. Add noexcept and const.
Backport of changeset 8296:d8dc184c713c.
Diffstat (limited to 'src/Indicator.cxx')
-rw-r--r--src/Indicator.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Indicator.cxx b/src/Indicator.cxx
index fea9f4011..c08b87965 100644
--- a/src/Indicator.cxx
+++ b/src/Indicator.cxx
@@ -28,12 +28,12 @@ static PRectangle PixelGridAlign(const PRectangle &rc) noexcept {
Sci::round(rc.right), std::floor(rc.bottom));
}
-void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, const PRectangle &rcCharacter, DrawState drawState, int value) const {
+void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, const PRectangle &rcCharacter, State state, int value) const {
StyleAndColour sacDraw = sacNormal;
if (Flags() & SC_INDICFLAG_VALUEFORE) {
sacDraw.fore = ColourDesired(value & SC_INDICVALUEMASK);
}
- if (drawState == drawHover) {
+ if (state == State::hover) {
sacDraw = sacHover;
}
const IntegerRectangle irc(rc);
@@ -193,7 +193,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
PRectangle rcBox = PixelGridAlign(rc);
rcBox.top = rcLine.top + 1;
rcBox.bottom = rcLine.bottom;
- IntegerRectangle ircBox(rcBox);
+ const IntegerRectangle ircBox(rcBox);
// Cap width at 4000 to avoid large allocations when mistakes made
const int width = std::min(ircBox.Width(), 4000);
RGBAImage image(width, ircBox.Height(), 1.0, nullptr);
@@ -268,6 +268,6 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
}
}
-void Indicator::SetFlags(int attributes_) {
+void Indicator::SetFlags(int attributes_) noexcept {
attributes = attributes_;
}