diff --git a/gfx/common/metal/TexturedView.m b/gfx/common/metal/TexturedView.m index 89859ec2b0..e41355f3a5 100644 --- a/gfx/common/metal/TexturedView.m +++ b/gfx/common/metal/TexturedView.m @@ -86,20 +86,16 @@ _frame = frame; - // update vertices - CGPoint o = frame.origin; - CGSize s = frame.size; - - float l = o.x; - float t = o.y; - float r = o.x + s.width; - float b = o.y + s.height; + float l = (float)CGRectGetMinX(frame); + float t = (float)CGRectGetMinY(frame); + float r = (float)CGRectGetMaxX(frame); + float b = (float)CGRectGetMaxY(frame); Vertex v[4] = { - {{l, b, 0}, {0, 1}}, - {{r, b, 0}, {1, 1}}, - {{l, t, 0}, {0, 0}}, - {{r, t, 0}, {1, 0}}, + {simd_make_float3(l, b, 0), simd_make_float2(0, 1)}, + {simd_make_float3(r, b, 0), simd_make_float2(1, 1)}, + {simd_make_float3(l, t, 0), simd_make_float2(0, 0)}, + {simd_make_float3(r, t, 0), simd_make_float2(1, 0)}, }; memcpy(_v, v, sizeof(_v)); }