PTCreateToolBase
@interface PTCreateToolBase : PTTool {
int _pageNumber;
double _thickness;
}
An abstract class that many of the annotation-creating tools derive from.
-
Undocumented
Declaration
Objective-C
int _pageNumber
-
Undocumented
Declaration
Objective-C
double _thickness
-
The thickness of the annotation’s stroke.
Declaration
Objective-C
@property (nonatomic, readonly) double thickness;
Swift
var thickness: Double { get }
-
The line ending style of the annotation’s start point.
Declaration
Objective-C
@property (nonatomic, readonly) PTEndingStyle startStyle;
Swift
var startStyle: PTEndingStyle { get }
-
The line ending style of the annotation’s end point.
Declaration
Objective-C
@property (nonatomic, readonly) PTEndingStyle endStyle;
Swift
var endStyle: PTEndingStyle { get }
-
The pageNumber that this annotation will be created on.
Declaration
Objective-C
@property (nonatomic, readonly) int pageNumber;
Swift
var pageNumber: Int32 { get }
-
The rectangle defined by the points when the user first touched and his/her finger has moved to.
Declaration
Objective-C
@property (nonatomic, readonly) CGRect drawArea;
Swift
var drawArea: CGRect { get }
-
The point where the user’s finger first made contact with the
PTPDFViewCtrl
.Declaration
Objective-C
@property (nonatomic) CGPoint startPoint;
Swift
var startPoint: CGPoint { get set }
-
The point where the user’s finger first made contact with the
PTPDFViewCtrl
.Declaration
Objective-C
@property (nonatomic) CGPoint endPoint;
Swift
var endPoint: CGPoint { get set }
-
Whether this tool requires an editing interface (toolbar) to operate.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL requiresEditSupport;
Swift
var requiresEditSupport: Bool { get }
-
Sets up the drawing context with correct properties such as stroke and fill thickness and color, etc.
Declaration
Objective-C
- (double)setupContext:(nonnull CGContextRef)currentContext;
Swift
func setupContext(_ currentContext: CGContext) -> Double
Parameters
currentContext
The current context, typically that returned by
UIGraphicsGetCurrentContext()
. -
Saves new annotation default properties via
ColorDefaults
.Declaration
Objective-C
- (void)setPropertiesFromAnnotation:(nonnull PTAnnot *)annotation;
Swift
func setPropertiesFromAnnotation(_ annotation: PTAnnot)
Parameters
annotation
The annotation with properties that will be used when the next annotation of this type is created.
-
Restricts the input point to the PDFPage
pageNumber
.Declaration
Objective-C
- (CGPoint)boundToPageScreenPoint:(CGPoint)touchPoint withThicknessCorrection:(CGFloat)thickness;
Swift
func bound(toPageScreenPoint touchPoint: CGPoint, withThicknessCorrection thickness: CGFloat) -> CGPoint
Parameters
touchPoint
An input point, in screen (PTPDFViewCtrl) coordinates.
thickness
A thickness value that imposes a margin around the edge of the page.
-
Restricts the input point to the PDFPage
pageNumber
.Declaration
Objective-C
- (CGPoint)boundToPageScreenPoint:(CGPoint)touchPoint withPaddingLeft:(CGFloat)left right:(CGFloat)right bottom:(CGFloat)bottom top:(CGFloat)top;
Swift
func bound(toPageScreenPoint touchPoint: CGPoint, withPaddingLeft left: CGFloat, right: CGFloat, bottom: CGFloat, top: CGFloat) -> CGPoint
Parameters
touchPoint
An input point, in screen (PTPDFViewCtrl) coordinates.
left
A thickness value that imposes a margin at the left edge of the page.
right
A thickness value that imposes a margin at the right edge of the page.
bottom
A thickness value that imposes a margin at the bottom edge of the page.
top
A thickness value that imposes a margin at the left top of the page.