/paintcode-path-scale

Center and resize UIBezierPath generated by PaintCode App

Primary LanguageSwiftMIT LicenseMIT

PaintCodeScale

UIBezierPath's generated by PaintCode App are sometimes offscreen when imported to iOS, use this UIBezierPath extension to fit and center your paths into a desired CGRect.

Requirements

  • iOS 8.0+
  • Xcode 7.3

Installation

Drag UIBezierPath+.swift into your project.

Usage

After pasting the PaintCode generated code into your app, replace UIBezierPath.fill() in PaintCode code by

bezierPath.fit(into: rect).moveCenter(to: rect.center).fill()

This resize the bezier path bound rect to fit into rect without loosing quality and then center into the rect center.

Licence

PaintCodeScale is released under the MIT license.