From 38b32bde58520784fa2a02ef57223e84822dc215 Mon Sep 17 00:00:00 2001 From: KK <192938268@qq.com> Date: Thu, 8 Jan 2026 17:50:15 +0800 Subject: [PATCH] Add boundsProvider parameter to renderToImage function --- .../Spine/Extensions/SkeletonDrawableWrapper+CGImage.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spine-ios/Sources/Spine/Extensions/SkeletonDrawableWrapper+CGImage.swift b/spine-ios/Sources/Spine/Extensions/SkeletonDrawableWrapper+CGImage.swift index 9ddb991d4..ded43a780 100644 --- a/spine-ios/Sources/Spine/Extensions/SkeletonDrawableWrapper+CGImage.swift +++ b/spine-ios/Sources/Spine/Extensions/SkeletonDrawableWrapper+CGImage.swift @@ -39,9 +39,10 @@ public extension SkeletonDrawableWrapper { /// - size: The size of the `CGImage` that should be rendered. /// - backgroundColor: the background color of the image /// - scaleFactor: The scale factor. Set this to `UIScreen.main.scale` if you want to show the image in a view - func renderToImage(size: CGSize, backgroundColor: UIColor, scaleFactor: CGFloat = 1) throws -> CGImage? { + func renderToImage(size: CGSize, boundsProvider: BoundsProvider = SetupPoseBounds(), backgroundColor: UIColor, scaleFactor: CGFloat = 1) throws -> CGImage? { let spineView = SpineUIView( controller: SpineController(disposeDrawableOnDeInit: false), // Doesn't own the drawable + boundsProvider: boundsProvider, backgroundColor: backgroundColor ) spineView.frame = CGRect(origin: .zero, size: size)