PaintingFragment

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKPaintingFragment)
open class PaintingFragment : NSObject

A PaintingFragment holds the data to redraw a certain part of a Painting. This is mainly used for fast and efficient undo and redo.

Properties

  • The rectangle of the painting that this fragment represents.

    Declaration

    Swift

    public let bounds: CGRect
  • The size of the saved data.

    Declaration

    Swift

    public let dataLength: Int
  • The bitmap data that belongs to this fragment. This is stored on disk and retrieved when needed.

    Declaration

    Swift

    open var data: Data { get }

Initializers

  • Creates a new PaintingFragment with the given data and for the given bounds.

    Declaration

    Swift

    public init(data: Data, bounds: CGRect)

    Parameters

    data

    The bitmap data that belongs to this fragment.

    bounds

    The rectangle of the painting that this fragment represents.

Rendering

  • Applies the bitmap data of this fragment in the given painting.

    Declaration

    Swift

    open func apply(in painting: Painting)

    Parameters

    painting

    The painting to apply this fragment in.