mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
AK: Rename downcast<T> => verify_cast<T>
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
This commit is contained in:
parent
6215a9c2cb
commit
ee3a73ddbb
61 changed files with 262 additions and 262 deletions
|
@ -41,7 +41,7 @@ StringView LineBoxFragment::text() const
|
|||
{
|
||||
if (!is<TextNode>(layout_node()))
|
||||
return {};
|
||||
return downcast<TextNode>(layout_node()).text_for_rendering().substring_view(m_start, m_length);
|
||||
return verify_cast<TextNode>(layout_node()).text_for_rendering().substring_view(m_start, m_length);
|
||||
}
|
||||
|
||||
const Gfx::FloatRect LineBoxFragment::absolute_rect() const
|
||||
|
@ -56,7 +56,7 @@ int LineBoxFragment::text_index_at(float x) const
|
|||
{
|
||||
if (!is<TextNode>(layout_node()))
|
||||
return 0;
|
||||
auto& layout_text = downcast<TextNode>(layout_node());
|
||||
auto& layout_text = verify_cast<TextNode>(layout_node());
|
||||
auto& font = layout_text.font();
|
||||
Utf8View view(text());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue