- Kaunas, Lithuania
- https://aras-p.info/
- Joined on
2022-01-20
@matteolegna-2 yeah, only very limited set of curve types are supported right now. I know that @Germain-Le-Chapelain was a WIP PR to improve it in some way here: #117371 but I haven't followed…
@PratikPB2123 it is a good question however, how that many "broken" animation drivers ended up there. Maybe some operations within Blender itself create/leak drivers? In the LagTest.blend
…
The compiler can not know/assume that, generally. Inside the loop there's a function call to BLF_glyph_advance
and the compiler has no idea whatsoever what it does -- it can very much end up…
I added a handful of comments that while minor, should perhaps be addressed (the "possible crash on invalid text data" is perhaps the main one, but then some others wrt small performance issues too). Overall very nice!
Maybe for (const rcti &box
, no need to copy them for each loop iteration
No need to copy lines vector into this function, passing by reference would work fine
Should this break only on literal space, or on other "white space" characters (e.g. \t
)?
No need to keep on calling BLI_strnlen on each loop iteration, call it once before the loop
All of the TextVarsRuntime, LineInfo, CharInfo seem to be only used within effects.cc
, so they don't need to be in any header. And maybe rename TextVarsRuntime to some other name, since usually "Runtime" structs are for runtime fields within DNA types. Which is not the case here.
Why BLI_index_range.hh and BLI_span.hh includes are needed in this header?
Maybe "Horizontal alignment for multi-line text" sound easier to understand than "Align the text along the X axis"
Is the tooltip technically correct? I think the position of the text box is not relative to the image center, but rather to the "Location" property (which defaults to image center, yes).
BLI_str_utf8_size_or_error can return -1 for malformed UTF8 sequences, in which case the whole loop would probably start walking into nonsensical memory and crash. Maybe break out of the loop of char_length is <= 0?
btw I'm not too familiar with the whole units system, perhaps @ideasman42 would have better opinions