Skip to content

Commit 7055fb7

Browse files
committed
fix lint
1 parent 16a8eac commit 7055fb7

6 files changed

Lines changed: 21 additions & 29 deletions

File tree

src/ruis/paint/path.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,12 @@ path::vertices path::stroke(ruis::real half_width, ruis::real antialias_width, r
127127

128128
if (!prev) {
129129
ASSERT(next)
130-
ret.pos.push_back(
131-
(*cur) - normal * miter - normal.rot(-ruis::real(pi) / 4) * antialias_width * std::numbers::sqrt2_v<ruis::real>
132-
);
130+
ret.pos
131+
.push_back((*cur) - normal * miter - normal.rot(-ruis::real(pi) / 4) * antialias_width * std::numbers::sqrt2_v<ruis::real>);
133132
} else if (!next) {
134133
ASSERT(prev)
135-
ret.pos.push_back(
136-
(*cur) - normal * miter - normal.rot(ruis::real(pi) / 4) * antialias_width * std::numbers::sqrt2_v<ruis::real>
137-
);
134+
ret.pos
135+
.push_back((*cur) - normal * miter - normal.rot(ruis::real(pi) / 4) * antialias_width * std::numbers::sqrt2_v<ruis::real>);
138136
} else {
139137
ret.pos.push_back((*cur) - normal * antialias_miter);
140138
}
@@ -152,13 +150,11 @@ path::vertices path::stroke(ruis::real half_width, ruis::real antialias_width, r
152150
++in_index;
153151

154152
if (!prev) {
155-
ret.pos.push_back(
156-
(*cur) + normal * miter + normal.rot(ruis::real(pi) / 4) * antialias_width * std::numbers::sqrt2_v<ruis::real>
157-
);
153+
ret.pos
154+
.push_back((*cur) + normal * miter + normal.rot(ruis::real(pi) / 4) * antialias_width * std::numbers::sqrt2_v<ruis::real>);
158155
} else if (!next) {
159-
ret.pos.push_back(
160-
(*cur) + normal * miter + normal.rot(-ruis::real(pi) / 4) * antialias_width * std::numbers::sqrt2_v<ruis::real>
161-
);
156+
ret.pos
157+
.push_back((*cur) + normal * miter + normal.rot(-ruis::real(pi) / 4) * antialias_width * std::numbers::sqrt2_v<ruis::real>);
162158
} else {
163159
ret.pos.push_back((*cur) + normal * antialias_miter);
164160
}

src/ruis/render/context.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,13 @@ context::~context()
4949

5050
// remove all occurrencies of this context from current contexts stack,
5151
// because there can be several of them
52-
cur_context_stack.erase(
53-
std::remove(
54-
cur_context_stack.begin(), //
55-
cur_context_stack.end(),
56-
this
57-
),
58-
cur_context_stack.end()
59-
);
52+
{
53+
auto subrange_to_remove = std::ranges::remove(cur_context_stack, this);
54+
cur_context_stack.erase(
55+
subrange_to_remove.begin(), //
56+
subrange_to_remove.end()
57+
);
58+
}
6059

6160
if (!cur_context_stack.empty()) {
6261
cur_context_stack.back()->native_window.get().bind_rendering_context();

src/ruis/style/styled.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2121

2222
#pragma once
2323

24+
#include <concepts>
25+
2426
#include "style_provider.hpp"
2527

2628
namespace ruis {
@@ -155,12 +157,7 @@ class styled
155157
{}
156158

157159
template <
158-
typename convertible_type, //
159-
std::enable_if_t< //
160-
// NOLINTNEXTLINE(modernize-type-traits, "false-positive")
161-
std::is_convertible_v<convertible_type, actual_value_type>, //
162-
bool //
163-
> = true //
160+
std::convertible_to<actual_value_type> convertible_type //
164161
>
165162
styled(convertible_type conv) :
166163
value(actual_value_type(conv))

0 commit comments

Comments
 (0)