MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / DrawChildren

Method DrawChildren

Source/Engine/UI/GUI/Panels/DropPanel.cs:430–486  ·  view source on GitHub ↗

()

Source from the content-addressed store, hash-verified

428
429 /// <inheritdoc />
430 protected override void DrawChildren()
431 {
432 // Draw child controls that are not arranged (pined to the header, etc.)
433 for (int i = 0; i < _children.Count; i++)
434 {
435 var child = _children[i];
436 if (!child.IsScrollable && child.Visible)
437 {
438 Render2D.PushTransform(ref child._cachedTransform);
439 child.Draw();
440 Render2D.PopTransform();
441 }
442 }
443
444 // Check if isn't fully closed
445 if (!_isClosed || _animationProgress < 0.998f)
446 {
447 // Draw children with clipping mask (so none of the controls will override the header)
448 Rectangle clipMask = new Rectangle(0, HeaderHeight, Width, Height - HeaderHeight);
449 Render2D.PushClip(ref clipMask);
450 if (CullChildren)
451 {
452 Render2D.PeekClip(out var globalClipping);
453 Render2D.PeekTransform(out var globalTransform);
454 for (int i = 0; i < _children.Count; i++)
455 {
456 var child = _children[i];
457 if (child.IsScrollable && child.Visible)
458 {
459 Matrix3x3.Multiply(ref child._cachedTransform, ref globalTransform, out var globalChildTransform);
460 var childGlobalRect = new Rectangle(globalChildTransform.M31, globalChildTransform.M32, child.Width * globalChildTransform.M11, child.Height * globalChildTransform.M22);
461 if (globalClipping.Intersects(ref childGlobalRect))
462 {
463 Render2D.PushTransform(ref child._cachedTransform);
464 child.Draw();
465 Render2D.PopTransform();
466 }
467 }
468 }
469 }
470 else
471 {
472 for (int i = 0; i < _children.Count; i++)
473 {
474 var child = _children[i];
475 if (child.IsScrollable && child.Visible)
476 {
477 Render2D.PushTransform(ref child._cachedTransform);
478 child.Draw();
479 Render2D.PopTransform();
480 }
481 }
482 }
483
484 Render2D.PopClip();
485 }
486 }
487

Callers

nothing calls this directly

Calls 9

PopTransformMethod · 0.80
PeekClipMethod · 0.80
PeekTransformMethod · 0.80
PopClipMethod · 0.80
PushTransformMethod · 0.45
DrawMethod · 0.45
PushClipMethod · 0.45
MultiplyMethod · 0.45
IntersectsMethod · 0.45

Tested by

no test coverage detected