diff options
author | Neil <nyamatongwe@gmail.com> | 2020-06-10 10:51:46 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-06-10 10:51:46 +1000 |
commit | 6516d81f0ad2574e49732c0def87d19c5a23ddeb (patch) | |
tree | 1d23559c9e0d2d237eb29413c8d44cef14af6efd /src/Indicator.cxx | |
parent | 1cdba1d42d7cdec5bad6071f297ca1ce60fb6119 (diff) | |
download | scintilla-mirror-6516d81f0ad2574e49732c0def87d19c5a23ddeb.tar.gz |
Convert enum to enum class. Add noexcept and const.
Diffstat (limited to 'src/Indicator.cxx')
-rw-r--r-- | src/Indicator.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Indicator.cxx b/src/Indicator.cxx index 4ebf57b38..a09a64321 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -29,12 +29,12 @@ static PRectangle PixelGridAlign(const PRectangle &rc) noexcept { std::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); @@ -194,7 +194,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); @@ -269,6 +269,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_; } |