mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-29 18:48:09 +08:00
improve device_pixel_ratio_to_str
This commit is contained in:
parent
8cd53e9979
commit
4d1869dad3
@ -2,6 +2,7 @@
|
||||
|
||||
2024/11/03
|
||||
* 针对 awtk-android/awtk-ios/awtk-harmonyos-next 完善。
|
||||
* 完善 device_pixel_ratio_to_str
|
||||
|
||||
2024/11/01
|
||||
* preview_ui添加是否启用标准字体大小的参数(感谢培煌提供补丁)
|
||||
|
@ -171,11 +171,13 @@ static ret_t build_asset_filename_default(char* path, uint32_t size, const char*
|
||||
|
||||
static const char* device_pixel_ratio_to_str(float_t dpr) {
|
||||
const char* ratio = "x1";
|
||||
if (dpr >= 4) {
|
||||
int32_t idpr = tk_roundi(dpr);
|
||||
|
||||
if (idpr >= 4) {
|
||||
ratio = "x4";
|
||||
} else if (dpr >= 3) {
|
||||
} else if (idpr >= 3) {
|
||||
ratio = "x3";
|
||||
} else if (dpr >= 2) {
|
||||
} else if (idpr >= 2) {
|
||||
ratio = "x2";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user