summaryrefslogtreecommitdiff
path: root/%252525252525252525252525253fid%252525252525252525252525253de73651f12a4066297...
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-03-24 02:00:00 +0600
committerHiltjo Posthuma <hiltjo@codemadness.org>2022-03-25 22:49:07 +0100
commit6be057f060543bb0f3ed9423904263617cdffffe (patch)
tree1c38c588659ed513040068e3cafd6561b4917f55 /%252525252525252525252525253fid%252525252525252525252525253de73651f12a406629778f02d8e5acbe2caec0dfc2%2525252525252525252525253fid%2525252525252525252525253d31fa07b9849b0ffbf4b7efb55943f466b3ff160f%25252525252525252525253fid%25252525252525252525253d6818e07291f3b2913e687c8ec3d3fe4711724050%252525252525252525253fid%252525252525252525253d6818e07291f3b2913e687c8ec3d3fe4711724050%2525252525252525253fid%2525252525252525253d6818e07291f3b2913e687c8ec3d3fe4711724050&id2%2525252525252525253db43ec0577f2ad8ad33a0b893fe5360d966036786%25252525252525253fid%25252525252525253d6818e07291f3b2913e687c8ec3d3fe4711724050%252525252525253fid%252525252525253db43ec0577f2ad8ad33a0b893fe5360d966036786%2525252525253fid%2525252525253d22511c41d55a38a770541ae617a09383d5e6ad1c%25252525253fid%25252525253d77526f756e23e362081ac807521f901f2e5cd5e6%252525253fid%252525253d77526f756e23e362081ac807521f901f2e5cd5e6%2525253fid%2525253d7269c5355d257dd2ad2c53f15dc9c1cf6796aea5%25253fid%25253d7269c5355d257dd2ad2c53f15dc9c1cf6796aea5%253fid%253d6be057f060543bb0f3ed9423904263617cdffffe%3fid%3d6be057f060543bb0f3ed9423904263617cdffffe&id2%3d41fdabbf7c517f8d524b70cbd78238cc319ccef3?id=6be057f060543bb0f3ed9423904263617cdffffe
parent41fdabbf7c517f8d524b70cbd78238cc319ccef3 (diff)
introduce drw_fontset_getwidth_clamp()
getting the width of a string is an O(n) operation, and in many cases users only care about getting the width upto a certain number. instead of calling drw_fontset_getwidth() and *then* clamping the result, this patch introduces drw_fontset_getwidth_clamp() function, similar to strnlen(), which will stop once we reach n. the `invert` parameter was overloaded internally to preserve the API, however library users should be calling drw_fontset_getwidth_clamp() and not depend upon internal behavior of drw_text().
Diffstat (limited to '%252525252525252525252525253fid%252525252525252525252525253de73651f12a406629778f02d8e5acbe2caec0dfc2%2525252525252525252525253fid%2525252525252525252525253d31fa07b9849b0ffbf4b7efb55943f466b3ff160f%25252525252525252525253fid%25252525252525252525253d6818e07291f3b2913e687c8ec3d3fe4711724050%252525252525252525253fid%252525252525252525253d6818e07291f3b2913e687c8ec3d3fe4711724050%2525252525252525253fid%2525252525252525253d6818e07291f3b2913e687c8ec3d3fe4711724050&id2%2525252525252525253db43ec0577f2ad8ad33a0b893fe5360d966036786%25252525252525253fid%25252525252525253d6818e07291f3b2913e687c8ec3d3fe4711724050%252525252525253fid%252525252525253db43ec0577f2ad8ad33a0b893fe5360d966036786%2525252525253fid%2525252525253d22511c41d55a38a770541ae617a09383d5e6ad1c%25252525253fid%25252525253d77526f756e23e362081ac807521f901f2e5cd5e6%252525253fid%252525253d77526f756e23e362081ac807521f901f2e5cd5e6%2525253fid%2525253d7269c5355d257dd2ad2c53f15dc9c1cf6796aea5%25253fid%25253d7269c5355d257dd2ad2c53f15dc9c1cf6796aea5%253fid%253d6be057f060543bb0f3ed9423904263617cdffffe%3fid%3d6be057f060543bb0f3ed9423904263617cdffffe&id2%3d41fdabbf7c517f8d524b70cbd78238cc319ccef3?id=6be057f060543bb0f3ed9423904263617cdffffe')
0 files changed, 0 insertions, 0 deletions