rive-app/rive-ios

Errors when view height is zero

Opened this issue · 0 comments

Description

RiveView will try to render to a Metal view when its height is zero, which does not work:

-[MTLTextureDescriptorInternal validateWithDevice:], line 1344: error 'Texture Descriptor Validation
MTLTextureDescriptor has height of zero.
'
-[MTLTextureDescriptorInternal validateWithDevice:]:1344: failed assertion `Texture Descriptor Validation
MTLTextureDescriptor has height of zero.
'

It is perfectly fine for UIKit views to have a zero height, and this often happens when doing things like reveal or hide animations. However, Metal does not support rendering to a zero pixel high texture, so the rendering code needs to special-case check if any dimension of the view is zero and skip rendering in that case.