Skip to content

Instantly share code, notes, and snippets.

@Erinaaaaaaa
Last active May 31, 2020 21:03
Show Gist options
  • Save Erinaaaaaaa/25820290f3df953b71f4dfac77530345 to your computer and use it in GitHub Desktop.
Save Erinaaaaaaa/25820290f3df953b71f4dfac77530345 to your computer and use it in GitHub Desktop.
DrawSizePreservingFillContainer not behaving as expected when parent is padded (ppy/osu-framework issue #3592)
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osuTK;
using osuTK.Graphics;
namespace ProjectDiba.Game.Graphics.RhythmGame
{
public class NoteContainer : CompositeDrawable
{
public NoteContainer()
{
Padding = new MarginPadding
{
Top = 96,
Bottom = 192,
Horizontal = 32,
};
InternalChildren = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Red,
},
new DrawSizePreservingFillContainer()
{
RelativeSizeAxes = Axes.Both,
Width = 1, Height = 1,
TargetDrawSize = new Vector2(3600, 1600),
Child = new Box
{
Width = 3600,
Height = 1600,
Colour = Color4.Blue,
Alpha = 0.2f,
}
}
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment