ProtossGenius 1 dag geleden
committed by GitHub
bovenliggende
commit
83533e8eb5
Geen bekende sleutel gevonden voor deze handtekening in de database GPG sleutel-ID: B5690EEEBB952194
2 gewijzigde bestanden met toevoegingen van 6 en 2 verwijderingen
  1. +2
    -2
      src/platforms/rcore_web.c
  2. +4
    -0
      src/rcore.c

+ 2
- 2
src/platforms/rcore_web.c Bestand weergeven

@ -1591,8 +1591,8 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
// If the pointer is not locked, follow the position // If the pointer is not locked, follow the position
if (!CORE.Input.Mouse.cursorHidden) if (!CORE.Input.Mouse.cursorHidden)
{ {
CORE.Input.Mouse.currentPosition.x = (float)x;
CORE.Input.Mouse.currentPosition.y = (float)y;
CORE.Input.Mouse.currentPosition.x = (float) x * CORE.Window.screen.width / CORE.Window.initScreen.width;
CORE.Input.Mouse.currentPosition.y = (float) y * CORE.Window.screen.height / CORE.Window.initScreen.height;
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition; CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
} }

+ 4
- 0
src/rcore.c Bestand weergeven

@ -295,6 +295,7 @@ typedef struct CoreData {
Point position; // Window position (required on fullscreen toggle) Point position; // Window position (required on fullscreen toggle)
Point previousPosition; // Window previous position (required on borderless windowed toggle) Point previousPosition; // Window previous position (required on borderless windowed toggle)
Size display; // Display width and height (monitor, device-screen, LCD, ...) Size display; // Display width and height (monitor, device-screen, LCD, ...)
Size initScreen; // when init window, Screen width and height (used render area)
Size screen; // Screen width and height (used render area) Size screen; // Screen width and height (used render area)
Size previousScreen; // Screen previous width and height (required on borderless windowed toggle) Size previousScreen; // Screen previous width and height (required on borderless windowed toggle)
Size currentFbo; // Current render width and height (depends on active fbo) Size currentFbo; // Current render width and height (depends on active fbo)
@ -668,6 +669,9 @@ void InitWindow(int width, int height, const char *title)
// Initialize window data // Initialize window data
CORE.Window.screen.width = width; CORE.Window.screen.width = width;
CORE.Window.screen.height = height; CORE.Window.screen.height = height;
CORE.Window.initScreen.width = width;
CORE.Window.initScreen.height = height;
CORE.Window.eventWaiting = false; CORE.Window.eventWaiting = false;
CORE.Window.screenScale = MatrixIdentity(); // No draw scaling required by default CORE.Window.screenScale = MatrixIdentity(); // No draw scaling required by default
if ((title != NULL) && (title[0] != 0)) CORE.Window.title = title; if ((title != NULL) && (title[0] != 0)) CORE.Window.title = title;

Laden…
Annuleren
Opslaan