         {
             // We are already taking scale into account from the transform,
             // so adjust here since IUIComponent mixes it with width/height
-            height /= obj.scaleY;
+            height = (obj.scaleY == 0) ? 0 : height / obj.scaleY;
         }
 
         if (transformMatrix)

            {
                // We are already taking scale into account from the transform,
                // so adjust here since IUIComponent mixes it with width/height
                width /= obj.scaleX;
            }
            
            // By default the IUIComponent's registration point is the same

        {
            // We are already taking scale into account from the transform,
            // so adjust here since IUIComponent mixes it with width/height
            width = (obj.scaleX == 0) ? 0 : width / obj.scaleX;
        }

        if (transformMatrix)
