mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +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:
parent
32b9d80ee5
commit
c8c3828b59
1 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue