Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose tablet OutputSize #6460

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

DanielPower
Copy link

@DanielPower DanielPower commented Dec 16, 2024

Resolves #6150
Related to ppy/osu#12098
Required by ppy/osu#31141

Description

Exposes new bindables OutputAreaSize and OutputAreaPosition, so that absoluteOutputMode.Output can be updated from osu.Game. This is used by ppy/osu#31141 to scale the tablet output when screen scaling is set to "Everything".

@DanielPower DanielPower changed the title Initial proof of concept for tablet output scaling Allow modifying Tablet Output Area Dec 16, 2024
@DanielPower DanielPower changed the title Allow modifying Tablet Output Area Expose tablet OutputSize Dec 16, 2024
@@ -38,6 +38,8 @@ public class OpenTabletDriverHandler : InputHandler, IAbsolutePointer, IRelative

public Bindable<Vector2> AreaSize { get; } = new Bindable<Vector2>();

public Bindable<Vector2> OutputSize { get; } = new Bindable<Vector2>();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sold on this API design. I'd say this should be nullable, and if the output size is null, then it is presumed that the output area is the whole window (which would fall back to the old logic). Curious of other thoughts on this though @ppy/team-client

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OutputAreaSize now has a default value of Vector2(1f, 1f). So it behaves correctly on first launch.
OutputAreaPosition does not have a default value, but it's unused until the scaling mode is changed, at which point it will have been populated. I could give it a default of Vector2(0.5f, 0.5f) if that would be preferable.

I'm also open to making them nullable if that would be better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at things in their current state, I think I'm fine with the proposed API? Better than nullable values IMHO.

@hwsmm
Copy link
Contributor

hwsmm commented Dec 16, 2024

Seems like a duplicate of #6166?

@DanielPower
Copy link
Author

DanielPower commented Dec 16, 2024

Seems like a duplicate of #6166?

That's a good catch. I can close this and instead use #6166 as a base for ppy/osu#31141 if that would be preferable. Their PR is more complete as it also includes the output position, which may be useful for future configurability.

…een-scaling-tablet-output

# Conflicts:
#	osu.Framework/Input/Handlers/Tablet/ITabletHandler.cs
#	osu.Framework/Input/Handlers/Tablet/OpenTabletDriverHandler.cs
@pull-request-size pull-request-size bot added size/M and removed size/S labels Dec 17, 2024
…een-scaling-tablet-output

# Conflicts:
#	osu.Framework/Input/Handlers/Tablet/ITabletHandler.cs
#	osu.Framework/Input/Handlers/Tablet/OpenTabletDriverHandler.cs
… screen-scaling-tablet-output

# Conflicts:
#	osu.Framework/Input/Handlers/Tablet/ITabletHandler.cs
@DanielPower
Copy link
Author

#6166 is too outdated to work off of directly due to conflicts with osu.Game. So I've:

  1. merged @Feodor0090's changes into this branch
  2. updated Scale tablet output size when UI Scaling mode is "Everything" osu#31141 accordingly
  3. Updated some wording and simplified logic

Apologies, this has made the commit history a little messy. I can rebase if desired, but I'll leave it as-is for now since CONTRIBUTING.md discourages rebasing.

@DanielPower DanielPower marked this pull request as ready for review December 17, 2024 01:06
@DanielPower DanielPower requested a review from bdach December 17, 2024 01:09
@DanielPower DanielPower marked this pull request as draft December 17, 2024 01:11
@DanielPower DanielPower marked this pull request as ready for review December 17, 2024 01:23
Comment on lines -109 to -110
else
tablet.Value = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this change? this removal does not look correct in this context

@bdach
Copy link
Collaborator

bdach commented Dec 26, 2024

aside from the above this looks roughly correct, but was there even any testing done here? no changes to test scenes to even add sliders to play with this framework side or anything, so i question whether this was tested to work at all.

@peppy
Copy link
Member

peppy commented Dec 26, 2024

I assumed cross-testing with ppy/osu#31141, which looks to be working well for at least the user. I haven't personally tested, if we can have some minimal framework tests that definitely would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tablet input should have a property to allow adjusting the mapping target area
5 participants