1

I recently switched from using PaintCode 2 to PaintCode 3, I am using it together with xCode/Swift.

I noticed however, that all my image generating functions not behave differently. They seam to standard addopt cap insets.

As an example below you can find one canvas "ViewMissingImage", and how its configured in PaintCode (2 or 3 its identical).

enter image description here

Code generated via PaintCode 2

public class func imageOfViewMissingImage(frame frame: CGRect = CGRect(x: 6, y: 5, width: 109, height: 109)) -> UIImage {
    UIGraphicsBeginImageContextWithOptions(frame.size, false, 0)
        PaintCode.drawViewMissingImage(frame: CGRect(x: 0, y: 0, width: frame.size.width, height: frame.size.height))

    let imageOfViewMissingImage = UIGraphicsGetImageFromCurrentImageContext()
    UIGraphicsEndImageContext()

    return imageOfViewMissingImage
}

Code generated via PaintCode 3

public dynamic class func imageOfViewMissingImage(imageSize imageSize: CGSize = CGSize(width: 109, height: 109)) -> UIImage {
    UIGraphicsBeginImageContextWithOptions(imageSize, false, 0)
        PaintCode.drawViewMissingImage(frame: CGRect(x: 0, y: 0, width: imageSize.width, height: imageSize.height))

    let imageOfViewMissingImage = UIGraphicsGetImageFromCurrentImageContext()!.resizableImageWithCapInsets(UIEdgeInsetsZero, resizingMode: .Tile)
    UIGraphicsEndImageContext()

    return imageOfViewMissingImage
}

I think that the PaintCode 2 never used the capp insets, maybe it was a bug? I do not want these cap insets, how can I get rid of them?

4

1 回答 1

1

解决方案很简单:

在 PaintCode UI 中将 Cap Inset 放在“Stretch”而不是 tile 上!

于 2016-11-24T08:57:53.970 回答