Skip to content

Commit

Permalink
fix: macos scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
jolexxa committed Jan 1, 2025
1 parent d81a437 commit d898020
Show file tree
Hide file tree
Showing 23 changed files with 4 additions and 134,277 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nupkg/
/build/
addons/platform/builds

coverage/*
!coverage/.gdignore
Expand Down
13 changes: 1 addition & 12 deletions Chickensoft.Platform/src/extensions/Displays.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public float GetDisplayScaleFactor(Window window) {
}

private static float GetDisplayScaleFactorMacOS(Window window) {
GD.Print("MacOS");
// This will always be 1, 2, or 3, due to limited information from macOS.
// This scale factor represents the type of retina display, but not the
// user-adjusted logical resolution scaling. We can determine the actual
Expand All @@ -40,19 +39,9 @@ private static float GetDisplayScaleFactorMacOS(Window window) {
Mathf.RoundToInt(logicalResolutionRetina.Y / retinaScale)
);

GD.Print("Native resolution: ", nativeResolution);
GD.Print("Logical resolution: ", logicalResolution);

var scaleFactor = (float)nativeResolution.Y / logicalResolution.Y;
var inverseScaleFactor = logicalResolution.Y / (float)nativeResolution.Y;

GD.Print("Scale factor: ", scaleFactor);
GD.Print("Inverse scale factor: ", inverseScaleFactor);

var finalScaleFactor = inverseScaleFactor * retinaScale;
GD.Print("Final scale factor: ", finalScaleFactor);

return finalScaleFactor;
return scaleFactor;
}

private static float GetDisplayScaleFactorWindows(Window window) {
Expand Down
3 changes: 0 additions & 3 deletions addons/platform/builds/macos/Platform.debug.osx.arm64.dylib

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions addons/platform/builds/macos/Platform.debug.osx.x64.dylib

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions addons/platform/builds/macos/Platform.osx.arm64.dylib

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions addons/platform/builds/macos/Platform.osx.x64.dylib

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit d898020

Please sign in to comment.