A game framework written with osu! in mind.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix ModelBackedDrawable not working inside BufferedContainer

+34 -7
+25
osu.Framework.Tests/Visual/Drawables/TestSceneModelBackedDrawable.cs
··· 142 142 AddUntilStep("null model shown", () => backedDrawable.DisplayedDrawable is TestNullDrawableModel); 143 143 } 144 144 145 + [Test] 146 + public void TestInsideBufferedContainer() 147 + { 148 + TestDrawableModel drawableModel = null; 149 + 150 + AddStep("setup", () => 151 + { 152 + Child = new BufferedContainer 153 + { 154 + Anchor = Anchor.Centre, 155 + Origin = Anchor.Centre, 156 + Size = new Vector2(200), 157 + Child = backedDrawable = new TestModelBackedDrawable 158 + { 159 + RelativeSizeAxes = Axes.Both, 160 + HasIntermediate = false, 161 + ShowNullModel = false, 162 + Model = new TestModel(drawableModel = new TestDrawableModel(1).With(d => d.AllowLoad.Set())) 163 + } 164 + }; 165 + }); 166 + 167 + assertDrawableVisibility(1, () => drawableModel); 168 + } 169 + 145 170 private void assertIntermediateVisibility(bool hasIntermediate, Func<Drawable> getLastFunc) 146 171 { 147 172 if (hasIntermediate)
+9 -7
osu.Framework/Graphics/Containers/BufferedContainer.cs
··· 263 263 264 264 protected override DrawNode CreateDrawNode() => new BufferedContainerDrawNode(this, sharedData); 265 265 266 + public override bool UpdateSubTreeMasking(Drawable source, RectangleF maskingBounds) 267 + { 268 + var result = base.UpdateSubTreeMasking(source, maskingBounds); 269 + 270 + childrenUpdateVersion = updateVersion; 271 + 272 + return result; 273 + } 274 + 266 275 protected override RectangleF ComputeChildMaskingBounds(RectangleF maskingBounds) => ScreenSpaceDrawQuad.AABBFloat; // Make sure children never get masked away 267 276 268 277 private Vector2 lastScreenSpaceSize; ··· 311 320 312 321 screenSpaceSizeBacking.Validate(); 313 322 } 314 - } 315 - 316 - protected override void UpdateAfterChildren() 317 - { 318 - base.UpdateAfterChildren(); 319 - 320 - childrenUpdateVersion = updateVersion; 321 323 } 322 324 323 325 /// <summary>