Cst816s: scale down SDL mouse coordinates according to MONITOR_ZOOM
The lv_drivers provided monitor driver supports a `MONITOR_ZOOM`-factor which scales the window by the set factor. This is 'useful when simulating small screens'. The zoom can be set as cmake configuration setting `-DMONITOR_ZOOM=1`. Probably even more usefull for high-dpi screens where 240 pixels is really tiny.
This commit is contained in:
@@ -55,6 +55,13 @@ file(GLOB_RECURSE SOURCES "lv_drivers/*.c" "${InfiniTime_DIR}/src/libs/lvgl/src
|
||||
|
||||
add_executable(infinisim main.cpp ${SOURCES} ${INCLUDES})
|
||||
|
||||
set(MONITOR_ZOOM 1 CACHE STRING "Scale simulator window by this factor")
|
||||
if(MONITOR_ZOOM MATCHES "^[0-9]\.?[0-9]*")
|
||||
target_compile_definitions(infinisim PRIVATE MONITOR_ZOOM=${MONITOR_ZOOM})
|
||||
else()
|
||||
message(FATAL_ERROR "variable MONITOR_ZOOM=${MONITOR_ZOOM} must be a positive number")
|
||||
endif()
|
||||
|
||||
# include the generated lv_conf.h file before anything else
|
||||
target_include_directories(infinisim PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
|
Reference in New Issue
Block a user