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 | c6f1f1c7c7f486fd19c394a7e33df9f0980b55c8 (patch) | |
| tree | 7e9ef4edb5853eccbcb2665a47657ec23584a2c5 /src/Indicator.cxx | |
| parent | 4b4de8537bdc20fc858e8a6258e80181ac417fe8 (diff) | |
| download | scintilla-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.cxx | 8 |
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_; } |
