lvgl / lv_drivers

TFT and touch pad drivers for LVGL embedded GUI library
https://docs.lvgl.io/master/porting/index.html
MIT License
306 stars 314 forks source link

Add some improvements for the new native Windows driver (win32drv) #139

Closed MouriNaruto closed 3 years ago

MouriNaruto commented 3 years ago

Before

image

After

image

kisvegabor commented 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.

MouriNaruto commented 3 years ago

@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.

kisvegabor commented 3 years ago

Thanks! In LVGL something like this is used to avoid floating-point numbers. E.g. (10 * 3) / 4.

MouriNaruto commented 3 years ago

@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.

kisvegabor commented 3 years ago

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.

MouriNaruto commented 3 years ago

Thanks for merging.

I meant I'll add it in the future.

Got it.