Closed MouriNaruto closed 3 years ago
As far as I can judge it looks good.
Side note: I didn't know the MulDiv
functions. What a great name for this common calculation. Probably I'll add something like this in lv_math.h
. :slightly_smiling_face:
Let me know if we can merge it.
@kisvegabor
Here is the documentation of 'MulDiv' function. https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-muldiv
It belongs to Large Integers functions. https://docs.microsoft.com/en-us/windows/win32/winprog/large-integers
The function multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value. The final result is rounded to the nearest integer. It's a common API used in the High DPI support.
Thanks! In LVGL something like this is used to avoid floating-point numbers. E.g. (10 * 3) / 4
.
@kisvegabor
In LVGL something like this is used to avoid floating-point numbers.
But I do some search and don't find the similar API in lv_math.h.
Probably I'll add something like this in lv_math.h. slightly_smiling_face
But I do some search and don't find the similar API in lv_math.h.
I meant I'll add it in the future.
Anyway, as the PR looks good, so I merge it.
Thanks for merging.
I meant I'll add it in the future.
Got it.
Before
After