mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
Add automatic update Button rect function
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
#include "CoordinateTools.h"
|
||||
|
||||
std::pair<int, int> physicalToLogical(const float screenX, const float screenY, SDL_Renderer* renderer) {
|
||||
if (renderer == nullptr) {
|
||||
SDL_Log("Renderer is null in physicalToLogical\n");
|
||||
return {static_cast<int>(screenX), static_cast<int>(screenY)};
|
||||
}
|
||||
|
||||
// 将窗口坐标转为逻辑坐标
|
||||
float logicalX, logicalY;
|
||||
SDL_RenderCoordinatesFromWindow(
|
||||
|
||||
Reference in New Issue
Block a user