Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-01-19 21:52:59 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-01-19 21:54:07 +0300
commit075def8fbda709e9db9086e9f2800a56103eb35d (patch)
treec706af87879cafc2d784a627cd6243f0d6f4a724 /source/blender/editors/space_text
parentfa91b43e8cbe55179bfb783be4371e8bc50e9d74 (diff)
Util function to determine number of digits from an integer
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/text_draw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 70b5feac280..4eb66811c7d 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -594,7 +594,7 @@ static void text_update_drawcache(SpaceText *st, ARegion *ar)
drawcache->total_lines = 0;
if (st->showlinenrs)
- st->linenrs_tot = (int)floor(log10((float)nlines)) + 1;
+ st->linenrs_tot = integer_digits_i(nlines);
while (line) {
if (drawcache->valid_head) { /* we're inside valid head lines */
@@ -628,7 +628,7 @@ static void text_update_drawcache(SpaceText *st, ARegion *ar)
nlines = BLI_listbase_count(&txt->lines);
if (st->showlinenrs)
- st->linenrs_tot = (int)floor(log10((float)nlines)) + 1;
+ st->linenrs_tot = integer_digits_i(nlines);
}
drawcache->total_lines = nlines;