mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibGfx: Avoid invalidation when Path::close() is a no-op
If the path is already closed, calling close() is a no-op, and we don't need to invalidate the split lines cache.
This commit is contained in:
@@ -118,8 +118,6 @@ void Path::close()
|
||||
if (m_segments.size() <= 1)
|
||||
return;
|
||||
|
||||
invalidate_split_lines();
|
||||
|
||||
auto& last_point = m_segments.last().point();
|
||||
|
||||
for (ssize_t i = m_segments.size() - 1; i >= 0; --i) {
|
||||
@@ -128,6 +126,7 @@ void Path::close()
|
||||
if (last_point == segment.point())
|
||||
return;
|
||||
append_segment<LineSegment>(segment.point());
|
||||
invalidate_split_lines();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user