Stay organized with collections
Save and categorize content based on your preferences.
blockly > utils > dom > startTextWidthCache
utils.dom.startTextWidthCache() function
Start caching text widths. Every call to this function MUST also call stopTextWidthCache. Caches must not survive between execution threads.
Signature:
export declare function startTextWidthCache(): void;
Returns:
void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["Initializes a cache for measuring text widths, improving performance for frequent text measurements."],["This function must be paired with `stopTextWidthCache()` to properly manage the cache and prevent memory leaks."],["Text width caches should not persist across different execution threads to avoid data inconsistencies."],["The function primarily serves as an internal optimization for Blockly and does not typically require direct user interaction."]]],["The `startTextWidthCache()` function initiates the caching of text widths. It's crucial that each invocation of this function is paired with a subsequent call to `stopTextWidthCache()`. The caching mechanism is designed for temporary use within a single execution thread and should not persist across different threads. This function does not return any value.\n"]]