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

Draw size preserving fill container #1077

Merged
merged 6 commits into from Oct 12, 2017

Conversation

Tom94
Copy link
Collaborator

@Tom94 Tom94 commented Oct 12, 2017

Introduces DrawSizePreservingFillContainer as a generalization of RatioAdjust from https://github.com/ppy/osu . Once this is merged in, ppy/osu#1359 removes RatioAdjust and replaces it with this.

Further, this PR uses DrawSizePreservingFillContainer within VisualTestGame to make the tests usable on HiDPI screens.

DrawSizePreservingFillContainer allows filling the parent while enforcing a given TargetDrawSize. This is useful, for example, to automatically scale the user interface according to the window resolution, or to provide automatic HiDPI display support.
using osu.Framework.Platform;
using osu.Framework.Testing;

namespace osu.Framework.Tests
{
internal class VisualTestGame : TestGame
internal class VisualTestGame : Game

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

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

No test case for this? Would be pretty neat to have a display of the different modes.

break;

case DrawSizePreservationStrategy.Maximum:
Scale = new Vector2(Math.Min(drawSizeRatio.X, drawSizeRatio.Y));

This comment was marked as off-topic.

break;
}


This comment was marked as off-topic.

@smoogipoo smoogipoo merged commit f1cda48 into ppy:master Oct 12, 2017
@Tom94 Tom94 deleted the draw-size-preserving-fill-container branch November 14, 2019 03:52
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.

None yet

3 participants