From c6f1f1c7c7f486fd19c394a7e33df9f0980b55c8 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 10 Jun 2020 10:51:46 +1000 Subject: Backport: Convert enum to enum class. Add noexcept and const. Backport of changeset 8296:d8dc184c713c. --- src/Indicator.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Indicator.cxx') 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_; } -- cgit v1.2.3