Skip to content

Truly independent web browser

LibCompositing: Grow the dense scroll offset store geometrically

Aliaksandr Kalenikc6ee7f6afdd9
diff --git a/Libraries/LibCompositing/Scrolling/ScrollState.h b/Libraries/LibCompositing/Scrolling/ScrollState.h
index f29bf983807..67fdeafb190 100644
--- a/Libraries/LibCompositing/Scrolling/ScrollState.h
+++ b/Libraries/LibCompositing/Scrolling/ScrollState.h
@@ -45,8 +45,10 @@ public:
{
if (index.value() >= m_node_count)
return;
- if (index.value() >= m_device_offsets.size())
+ if (index.value() >= m_device_offsets.size()) {
+ m_device_offsets.grow_capacity(index.value() + 1);
m_device_offsets.resize(index.value() + 1);
+ }
m_device_offsets[index.value()] = offset;
}