private void UpdatePositionBox() { var mat = _TransformNode.GetAncestorSpecificNode <TransformNode>()?.InheritedTransform ?? Matrix44F.Identity; var pos = mat.Transform3D(new Vector3F(_TransformNode.Position.X, _TransformNode.Position.Y, 0)); SetPoint(_PositionBox, new Vector2F(pos.X, pos.Y), 8, new Color(255, 0, 0)); }
//private Vector2F GetAncestorSize() //{ // var ancestor = _TransformNode.GetAncestorSpecificNode<ISized>(); // return ancestor switch // { // TransformNode t => t.Size / t.Scale, // ISized s => s.Size, // _ => new Vector2F() // }; //} internal void Draw() { var mat = _TransformNode.GetAncestorSpecificNode <TransformNode>()? .InheritedTransform ?? Matrix44F.Identity; void draw(RenderedPolygon renderedPolygon) { renderedPolygon.Transform = mat; Engine.Renderer.DrawPolygon(renderedPolygon); }; for (int i = 0; i < _SizeBoxLines.Length; i++) { draw(_SizeBoxLines[i]); } draw(_PivotBox); draw(_LeftTop); draw(_RightBottom); draw(_AnchorMin); draw(_AnchorMax); }