Skip to content

[FEATURE] Optimisation of detection of size of text in nodes in AST with a binary search. #5

Description

@fullwoodenshovel

This block of code (responsible for detecting what the maximum size of text that would be smaller than spacing / 1.7) could be optimised by using a binary search instead of a linear search:

while
let TextDimensions { width: test_width, offset_y: test_y, .. } = measure_text(text, None, scale, 1.0) &&
test_width > spacing / 1.7
{
scale -= 1; // could be optimised with binary search instead
text_width = test_width;
offset_y = test_y;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions