Improve macOS Retina UI clarity and bundle HD assets
This commit is contained in:
+10
-1
@@ -4,6 +4,7 @@
|
||||
#include "input_keymap.h"
|
||||
#include "texture_decode.h"
|
||||
#include "ui_scale.h"
|
||||
#include "ui_quality.h"
|
||||
|
||||
#ifdef MT_NATIVE_HAS_LIVE_CLIENT
|
||||
#include "platform/ScriptLib/PythonBoot.h"
|
||||
@@ -233,7 +234,8 @@ bool VulkanWindow::poll(bool forward_to_live_client) {
|
||||
flush_mouse_move();
|
||||
#endif
|
||||
if (event.type == SDL_EVENT_QUIT) return false;
|
||||
if (event.type == SDL_EVENT_WINDOW_RESIZED || event.type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) {
|
||||
if (event.type == SDL_EVENT_WINDOW_RESIZED || event.type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED ||
|
||||
event.type == SDL_EVENT_WINDOW_DISPLAY_SCALE_CHANGED || event.type == SDL_EVENT_WINDOW_DISPLAY_CHANGED) {
|
||||
int ew = 0, eh = 0;
|
||||
SDL_GetWindowSize(window_, &ew, &eh);
|
||||
touch_controller.update_screen_size(int(logical_width()), int(logical_height()), ui_safe_inset());
|
||||
@@ -244,6 +246,13 @@ bool VulkanWindow::poll(bool forward_to_live_client) {
|
||||
}
|
||||
#endif
|
||||
recreate_swapchain();
|
||||
#ifdef MT_NATIVE_HAS_LIVE_CLIENT
|
||||
if (forward_to_live_client) {
|
||||
int scale = font_raster_scale(float(width()) / float(std::max(1u, logical_width())));
|
||||
if (const char* env = std::getenv("MT_FONT_OVERSAMPLE")) scale = std::max(1, std::atoi(env));
|
||||
UISetFontOversample(scale);
|
||||
}
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (event.type == SDL_EVENT_FINGER_DOWN) {
|
||||
|
||||
Reference in New Issue
Block a user