Skip to content

Fix not respecting Device Simulator safearea in Standalone Editor mode#73

Open
DDRKirbyISQ wants to merge 2 commits into5argon:masterfrom
DDRKirbyISQ:patch-1
Open

Fix not respecting Device Simulator safearea in Standalone Editor mode#73
DDRKirbyISQ wants to merge 2 commits into5argon:masterfrom
DDRKirbyISQ:patch-1

Conversation

@DDRKirbyISQ
Copy link
Copy Markdown

In #60 the ToScreenRelativeRect logic was changed for standalone builds.

However, using the device simulator in the Unity Editor (NotchSolutionUtilityEditor.UnityDeviceSimulatorActive) is still possible even when UNITY_STANDALONE is true, i.e. if you want to check some device simulation without changing your active editor platform.

This adds a guard so that Screen.currentResolution is still used in this case.

The logic is a little clunky because of the preprocessor logic and because we need to account for NotchSolutionUtilityEditor being editor-only; ideally you'd probably create a property that abstracts this logic but I wanted to patch this with as small of a change as possible

In 5argon#60 the ToScreenRelativeRect logic was changed for standalone builds.

However, using the device simulator in the Unity Editor (NotchSolutionUtilityEditor.UnityDeviceSimulatorActive) is still possible even when UNITY_STANDALONE is true, i.e. if you want to check some device simulation without changing your active editor platform.

This adds a guard so that Screen.currentResolution is still used in this case.
@DDRKirbyISQ
Copy link
Copy Markdown
Author

I guess it's worth noting that some other platforms may need some additional support/fixes, as noted in #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant