- Kaunas, Lithuania
- https://aras-p.info/
- Joined on
2022-01-20
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
Not quite like hardcoding unit system indices in that way. As far as I can tell, these would only work as long as no one reorders to alters the unit systems arrays inside unit.cc
. Would it be better to use something like BKE_unit_base_scalar
to get the scaling factors instead?
That's an interesting idea, but it makes me wonder: should some other formats that are "unit-less" (e.g. OBJ, PLY) also get the same feature?
which is actually why this change has been in the back of my mind for a while :)
Ah!
but I'm sure there are smarter ways to compress a potentially sparse array
If the "sparse array"…
Ha! I was just looking at a very similar topic some 1.5 years ago. Two possible notes:
- At least in my tests back then, zstd compression level 1 was a tiny bit of compression ratio loss, but…