Unverified Commit 9da68fcd authored by Gary Qian's avatar Gary Qian Committed by GitHub

Cache caret parameters (#38821)

parent b7abf56a
......@@ -782,6 +782,10 @@ class TextPainter {
offset: rect != null ? Offset(rect.left, rect.top) : _emptyOffset,
fullHeight: rect != null ? rect.bottom - rect.top : null,
);
// Cache the input parameters to prevent repeat work later.
_previousCaretPosition = position;
_previousCaretPrototype = caretPrototype;
}
/// Returns a list of rects that bound the given selection.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment