|
@@ -172,20 +172,18 @@ import Cocoa
|
|
|
|
|
|
func reloadData() {
|
|
func reloadData() {
|
|
guard let fillColorPickerView = fillColorPickerView else { return }
|
|
guard let fillColorPickerView = fillColorPickerView else { return }
|
|
- guard let annotation = self.annotation else { return }
|
|
|
|
if annotations.count > 0 {
|
|
if annotations.count > 0 {
|
|
- if let presetValue = annotation.buttonWidgetStateString() {
|
|
|
|
- annotation.setButtonWidgetStateString(presetValue)
|
|
|
|
|
|
+ if let presetValue = annotation?.buttonWidgetStateString() {
|
|
|
|
+ annotation?.setButtonWidgetStateString(presetValue)
|
|
}
|
|
}
|
|
var opacity: CGFloat = 1
|
|
var opacity: CGFloat = 1
|
|
- let color = annotation.backgroundColor
|
|
|
|
|
|
+ let color = annotation?.backgroundColor
|
|
if color != nil {
|
|
if color != nil {
|
|
color!.usingColorSpaceName(.calibratedRGB)?.getRed(nil, green:nil, blue: nil, alpha: &opacity)
|
|
color!.usingColorSpaceName(.calibratedRGB)?.getRed(nil, green:nil, blue: nil, alpha: &opacity)
|
|
}
|
|
}
|
|
|
|
|
|
- let fontColor = annotation.fontColor
|
|
|
|
- let isTextWidget = (annotation.isKind(of: CPDFTextWidgetAnnotation.self))
|
|
|
|
- if isTextWidget {
|
|
|
|
|
|
+ let fontColor = annotation?.fontColor
|
|
|
|
+ if let isTextWidget = (annotation?.isKind(of: CPDFTextWidgetAnnotation.self)), isTextWidget {
|
|
fillColorPickerView.color = color
|
|
fillColorPickerView.color = color
|
|
colorPickerView.color = fontColor
|
|
colorPickerView.color = fontColor
|
|
|
|
|