From 0d84ef7da391ff193c944cb47b7a4eddeb61d8c3 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Fri, 24 Nov 2023 09:01:05 +1100 Subject: Feature [feature-requests:#1502] Simplify FlagSet expressions. --- src/EditView.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/EditView.cxx') diff --git a/src/EditView.cxx b/src/EditView.cxx index 0e136a8bf..a4fd701a7 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -2060,17 +2060,11 @@ void DrawFoldLines(Surface *surface, const EditModel &model, const ViewStyle &vs const ColourRGBA foldLineColour = vsDraw.ElementColour(Element::FoldLine).value_or( vsDraw.styles[StyleDefault].fore); // Paint the line above the fold - if ((subLine == 0) && - ((expanded && (FlagSet(model.foldFlags, FoldFlag::LineBeforeExpanded))) - || - (!expanded && (FlagSet(model.foldFlags, FoldFlag::LineBeforeContracted))))) { + if ((subLine == 0) && FlagSet(model.foldFlags, (expanded ? FoldFlag::LineBeforeExpanded: FoldFlag::LineBeforeContracted))) { surface->FillRectangleAligned(Side(rcLine, Edge::top, 1.0), foldLineColour); } // Paint the line below the fold - if (lastSubLine && - ((expanded && (FlagSet(model.foldFlags, FoldFlag::LineAfterExpanded))) - || - (!expanded && (FlagSet(model.foldFlags, FoldFlag::LineAfterContracted))))) { + if (lastSubLine && FlagSet(model.foldFlags, (expanded ? FoldFlag::LineAfterExpanded : FoldFlag::LineAfterContracted))) { surface->FillRectangleAligned(Side(rcLine, Edge::bottom, 1.0), foldLineColour); // If contracted fold line drawn then don't overwrite with hidden line // as fold lines are more specific then hidden lines. -- cgit v1.2.3