improve native_window_sdl_resize

This commit is contained in:
lixianjing 2020-10-03 18:11:40 +08:00
parent 68504e4ec6
commit 2e6d54d7d4
2 changed files with 7 additions and 0 deletions

View File

@ -88,6 +88,12 @@ static ret_t native_window_sdl_resize(native_window_t* win, wh_t w, wh_t h) {
#if !defined(ANDROID) && !defined(IOS)
if (system_info()->lcd_orientation == LCD_ORIENTATION_0 && (w != info.w || h != info.h)) {
#ifdef WIN32
w = w * win->ratio;
h = h * win->ratio;
#endif/*WIN32*/
SDL_SetWindowSize(sdl->window, w, h);
}
#endif /*ANDROID*/

View File

@ -41,6 +41,7 @@ static ret_t ui_builder_default_on_widget_start(ui_builder_t* b, const widget_de
if (widget == NULL) {
log_debug("%s: not supported type %s\n", __FUNCTION__, type);
assert(!"not supported");
return RET_FAIL;
}
b->widget = widget;