private static void TessellateRectangleSquareCorners(Rectangle rect, List <Geometry> geoms) { var x = rect.Position.x; var y = rect.Position.y; var width = rect.Size.x; var height = rect.Size.y; // Don't generate any geometry for pattern fills since these are generated from another SceneNode if (rect.Fill != null && !(rect.Fill is PatternFill)) { Vector2[] vertices; UInt16[] indices; VectorUtils.TessellateRect(new Rect(x, y, width, height), out vertices, out indices); var solidFill = rect.Fill as SolidFill; var color = solidFill != null ? solidFill.Color : Color.white; color.a *= rect.Fill.Opacity; geoms.Add(new Geometry() { Vertices = vertices, Indices = indices, Color = color, Fill = rect.Fill, FillTransform = rect.FillTransform }); } if (rect.PathProps.Stroke != null && rect.PathProps.Stroke.HalfThickness > VectorUtils.Epsilon) { Vector2[] vertices; UInt16[] indices; VectorUtils.TessellateRectBorder(new Rect(x, y, width, height), rect.PathProps.Stroke.HalfThickness, out vertices, out indices); geoms.Add(new Geometry() { Vertices = vertices, Indices = indices, Color = rect.PathProps.Stroke.Color }); } }