mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:07:45 +00:00
LibGfx: Make Path::bounding_box() and Path::split_lines() const
Use a const_cast internally when segmentizing. As far as clients are concerned, these are const operations.
This commit is contained in:
parent
5726017414
commit
8c863ad959
1 changed files with 4 additions and 4 deletions
|
@ -169,10 +169,10 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
const NonnullRefPtrVector<Segment>& segments() const { return m_segments; }
|
const NonnullRefPtrVector<Segment>& segments() const { return m_segments; }
|
||||||
const auto& split_lines()
|
auto& split_lines() const
|
||||||
{
|
{
|
||||||
if (!m_split_lines.has_value()) {
|
if (!m_split_lines.has_value()) {
|
||||||
segmentize_path();
|
const_cast<Path*>(this)->segmentize_path();
|
||||||
VERIFY(m_split_lines.has_value());
|
VERIFY(m_split_lines.has_value());
|
||||||
}
|
}
|
||||||
return m_split_lines.value();
|
return m_split_lines.value();
|
||||||
|
@ -184,10 +184,10 @@ public:
|
||||||
m_split_lines.clear();
|
m_split_lines.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
const Gfx::FloatRect& bounding_box()
|
Gfx::FloatRect const& bounding_box() const
|
||||||
{
|
{
|
||||||
if (!m_bounding_box.has_value()) {
|
if (!m_bounding_box.has_value()) {
|
||||||
segmentize_path();
|
const_cast<Path*>(this)->segmentize_path();
|
||||||
VERIFY(m_bounding_box.has_value());
|
VERIFY(m_bounding_box.has_value());
|
||||||
}
|
}
|
||||||
return m_bounding_box.value();
|
return m_bounding_box.value();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue