|
@@ -7,6 +7,82 @@
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
|
+class KMTextFieldItemView: NSView {
|
|
|
+ private lazy var textF_: NSTextField = {
|
|
|
+ let view = NSTextField()
|
|
|
+ view.drawsBackground = false
|
|
|
+ view.isBezeled = false
|
|
|
+ return view
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var unitTF_: NSTextField = {
|
|
|
+ let view = NSTextField(labelWithString: "")
|
|
|
+ return view
|
|
|
+ }()
|
|
|
+
|
|
|
+ private lazy var unitIconIv_: NSImageView = {
|
|
|
+ let view = NSImageView()
|
|
|
+ return view
|
|
|
+ }()
|
|
|
+
|
|
|
+ var unitString: String = "" {
|
|
|
+ didSet {
|
|
|
+ self.unitTF_.stringValue = self.unitString
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var unitAttriString: NSAttributedString = NSAttributedString(string: "") {
|
|
|
+ didSet {
|
|
|
+ self.unitTF_.attributedStringValue = self.unitAttriString
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var unitIcon: NSImage? {
|
|
|
+ didSet {
|
|
|
+ self.unitIconIv_.image = self.unitIcon
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ required init?(coder: NSCoder) {
|
|
|
+ super.init(coder: coder)
|
|
|
+
|
|
|
+ self.initSubviews()
|
|
|
+ }
|
|
|
+
|
|
|
+ override init(frame frameRect: NSRect) {
|
|
|
+ super.init(frame: frameRect)
|
|
|
+
|
|
|
+ self.initSubviews()
|
|
|
+ }
|
|
|
+
|
|
|
+ func initSubviews() {
|
|
|
+ self.addSubview(self.textF_)
|
|
|
+ self.addSubview(self.unitTF_)
|
|
|
+ self.addSubview(self.unitIconIv_)
|
|
|
+
|
|
|
+ self.textF_.km_add_left_constraint(constant: 4)
|
|
|
+// self.textF_.km_add_right_constraint(equalTo: self.unitTF_, attribute: .left, constant: -4)
|
|
|
+ self.textF_.km_add_right_constraint(constant: -(8+16+4))
|
|
|
+ self.textF_.km_add_centerY_constraint()
|
|
|
+
|
|
|
+ self.unitTF_.km_add_right_constraint(constant: -4)
|
|
|
+ self.unitTF_.km_add_centerY_constraint()
|
|
|
+
|
|
|
+ self.unitIconIv_.km_add_right_constraint(constant: -8)
|
|
|
+ self.unitIconIv_.km_add_centerY_constraint()
|
|
|
+ self.unitIconIv_.km_add_size_constraint(size: .init(width: 16, height: 16))
|
|
|
+ }
|
|
|
+
|
|
|
+ override func draw(_ dirtyRect: NSRect) {
|
|
|
+ super.draw(dirtyRect)
|
|
|
+
|
|
|
+// let ctx = NSGraphicsContext.current?.cgContext
|
|
|
+// ctx?.saveGState()
|
|
|
+// ctx?.setLineWidth(1)
|
|
|
+// ctx?.restoreGState()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
public enum KMOperationState {
|
|
|
case none
|
|
|
case began
|
|
@@ -25,15 +101,31 @@ protocol KMEditImagePropertyViewControllerDelegate: NSObject {
|
|
|
func editImagePropertyViewControllerDidChanged(controller: KMEditImagePropertyViewController, type: KMEditImagePropertyViewControllerChangeType)
|
|
|
}
|
|
|
|
|
|
+// 12 °
|
|
|
class KMEditImagePropertyViewController: NSViewController {
|
|
|
|
|
|
@IBOutlet weak var backgroundView: NSView!
|
|
|
@IBOutlet weak var titleLabel: NSTextField!
|
|
|
- @IBOutlet weak var editImageView: NSImageView!
|
|
|
+// @IBOutlet weak var editImageView: NSImageView!
|
|
|
|
|
|
@IBOutlet weak var headerBox: NSBox!
|
|
|
@IBOutlet weak var headerBoxHeight: NSLayoutConstraint!
|
|
|
- @IBOutlet weak var headerBoxMaginWidthConstraint: NSLayoutConstraint!
|
|
|
+// @IBOutlet weak var headerBoxMaginWidthConstraint: NSLayoutConstraint!
|
|
|
+
|
|
|
+ @IBOutlet weak var whTitleLabel: NSTextField!
|
|
|
+ @IBOutlet weak var wTextFieldItemView: KMTextFieldItemView!
|
|
|
+ @IBOutlet weak var whBox: NSBox!
|
|
|
+ @IBOutlet weak var hTextFieldItemView: KMTextFieldItemView!
|
|
|
+
|
|
|
+ var whVC: KMDesignButton?
|
|
|
+
|
|
|
+ @IBOutlet weak var rotateTitleLabel: NSTextField!
|
|
|
+ @IBOutlet weak var rotateTextFieldItemView: KMTextFieldItemView!
|
|
|
+ @IBOutlet weak var leftRotateBox: NSBox!
|
|
|
+ @IBOutlet weak var rightRotateBox: NSBox!
|
|
|
+
|
|
|
+ var leftRotateVC: KMDesignButton?
|
|
|
+ var rightRotateVC: KMDesignButton?
|
|
|
|
|
|
@IBOutlet weak var opacityTitleLabel: NSTextField!
|
|
|
@IBOutlet weak var opacitySlider: NSSlider!
|
|
@@ -41,21 +133,28 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
@IBOutlet weak var opacityBoxBottomMaginConstraint: NSLayoutConstraint!
|
|
|
@IBOutlet weak var opacityBoxTopConstraint: NSLayoutConstraint!
|
|
|
|
|
|
+ @IBOutlet weak var turnOverTitleLabel: NSTextField!
|
|
|
+ @IBOutlet weak var reverseXBox: NSView!
|
|
|
+ @IBOutlet weak var reverseYBox: NSView!
|
|
|
+
|
|
|
+ var reverseXVC: KMDesignButton?
|
|
|
+ var reverseYVC: KMDesignButton?
|
|
|
+
|
|
|
@IBOutlet weak var cropBox: NSBox!
|
|
|
@IBOutlet weak var confirmBox: NSBox!
|
|
|
@IBOutlet weak var cancelBox: NSBox!
|
|
|
@IBOutlet weak var replaceBox: NSBox!
|
|
|
@IBOutlet weak var exportBox: NSBox!
|
|
|
|
|
|
- @IBOutlet weak var imageBox: NSBox!
|
|
|
- @IBOutlet weak var imageBoxHeight: NSLayoutConstraint!
|
|
|
+// @IBOutlet weak var imageBox: NSBox!
|
|
|
+// @IBOutlet weak var imageBoxHeight: NSLayoutConstraint!
|
|
|
@IBOutlet weak var opacityBoxHeight: NSLayoutConstraint!
|
|
|
@IBOutlet weak var buttonBoxHeight: NSLayoutConstraint!
|
|
|
@IBOutlet weak var buttonBox: NSBox!
|
|
|
- @IBOutlet weak var rotateLeftBox: NSBox!
|
|
|
- @IBOutlet weak var rotateRightBox: NSBox!
|
|
|
- @IBOutlet weak var flipHorizontalBox: NSBox!
|
|
|
- @IBOutlet weak var flipVerticalBox: NSBox!
|
|
|
+// @IBOutlet weak var rotateLeftBox: NSBox!
|
|
|
+// @IBOutlet weak var rotateRightBox: NSBox!
|
|
|
+// @IBOutlet weak var flipHorizontalBox: NSBox!
|
|
|
+// @IBOutlet weak var flipVerticalBox: NSBox!
|
|
|
|
|
|
@IBOutlet weak var alignmentView: KMEditPropertyAlignmentView!
|
|
|
@IBOutlet weak var alignmentViewTopConstraint: NSLayoutConstraint!
|
|
@@ -73,6 +172,8 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
var flipVerticalVC: KMDesignPropertySelector?
|
|
|
var opacityVC: KMDesignSelect?
|
|
|
|
|
|
+ @IBOutlet weak var toolsTitleLabel: NSTextField!
|
|
|
+
|
|
|
var cropVC: KMDesignButton?
|
|
|
var confirmVC: KMDesignButton?
|
|
|
var cancelVC: KMDesignButton?
|
|
@@ -151,19 +252,54 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
// self.opacityTitleLabel.textColor = NSColor.km_init(hex: "#616469")
|
|
|
self.opacityTitleLabel.textColor = KMAppearance.Layout.h0Color()
|
|
|
|
|
|
- self.imageBox.borderWidth = 1
|
|
|
+// self.imageBox.borderWidth = 1
|
|
|
// self.imageBox.borderColor = NSColor.km_init(hex: "#DFE1E5")
|
|
|
- self.imageBox.cornerRadius = 4
|
|
|
+// self.imageBox.cornerRadius = 4
|
|
|
// self.imageBox.fillColor = NSColor.km_init(hex: "#FFFFFF")
|
|
|
|
|
|
- self.imageBox.borderColor = KMAppearance.Interactive.s0Color()
|
|
|
- self.imageBox.fillColor = KMAppearance.Layout.l1Color()
|
|
|
- self.imageBox.backgroundColor(KMAppearance.Layout.l1Color())
|
|
|
+// self.imageBox.borderColor = KMAppearance.Interactive.s0Color()
|
|
|
+// self.imageBox.fillColor = KMAppearance.Layout.l1Color()
|
|
|
+// self.imageBox.backgroundColor(KMAppearance.Layout.l1Color())
|
|
|
+
|
|
|
+ self.whTitleLabel.stringValue = NSLocalizedString("Size", comment: "")
|
|
|
+ for itemView in [self.wTextFieldItemView, self.hTextFieldItemView, self.rotateTextFieldItemView] {
|
|
|
+ itemView?.wantsLayer = true
|
|
|
+ itemView?.layer?.cornerRadius = 4
|
|
|
+ itemView?.layer?.borderWidth = 1
|
|
|
+ itemView?.layer?.borderColor = NSColor(hex: "#DFE1E5").cgColor
|
|
|
+ }
|
|
|
+ self.wTextFieldItemView.unitIcon = NSImage(named: "KMImageNameEditPDFWidthIcon")
|
|
|
+ self.hTextFieldItemView.unitIcon = NSImage(named: "KMImageNameEditPDFHeightIcon")
|
|
|
|
|
|
self.alignmentView.didChange = {[unowned self] view, areasArray, boundsArray in
|
|
|
self.changeAreasAlign(areas: areasArray, newBounds: boundsArray)
|
|
|
}
|
|
|
|
|
|
+ self.whVC = KMDesignButton(withType: .Image)
|
|
|
+ self.whBox.contentView = self.whVC?.view
|
|
|
+ self.whBox.borderWidth = 0
|
|
|
+ self.whVC?.target = self
|
|
|
+ self.whVC?.action = #selector(whAction)
|
|
|
+ self.whVC?.image = NSImage(named: "KMImageNameEditPDFWhExchange")!
|
|
|
+ self.whVC?.pagination()
|
|
|
+
|
|
|
+ self.rotateTitleLabel.stringValue = NSLocalizedString("Rotate", comment: "")
|
|
|
+ self.leftRotateVC = KMDesignButton(withType: .Image)
|
|
|
+ self.leftRotateBox.contentView = self.leftRotateVC?.view
|
|
|
+ self.leftRotateBox.borderWidth = 0
|
|
|
+ self.leftRotateVC?.target = self
|
|
|
+ self.leftRotateVC?.action = #selector(leftRotationImageAction)
|
|
|
+ self.leftRotateVC?.image = NSImage(named: "KMImageNameEditPDFRotationLeft")!
|
|
|
+ self.leftRotateVC?.pagination()
|
|
|
+
|
|
|
+ self.rightRotateVC = KMDesignButton(withType: .Image)
|
|
|
+ self.rightRotateBox.contentView = self.rightRotateVC?.view
|
|
|
+ self.rightRotateBox.borderWidth = 0
|
|
|
+ self.rightRotateVC?.target = self
|
|
|
+ self.rightRotateVC?.action = #selector(rightRotationImageAction)
|
|
|
+ self.rightRotateVC?.image = NSImage(named: "KMImageNameEditPDFRotationRight")!
|
|
|
+ self.rightRotateVC?.pagination()
|
|
|
+
|
|
|
opacityVC = KMDesignSelect.init(withType: .PopButton)
|
|
|
opacityBox.contentView = opacityVC?.view
|
|
|
opacityBox.fillColor = KMAppearance.Layout.bgDrakColor()
|
|
@@ -187,42 +323,42 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
|
|
|
|
|
|
//alignment
|
|
|
- rotateLeftVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
|
|
|
- rotateLeftBox.contentView = rotateLeftVC?.view
|
|
|
- rotateLeftBox.fillColor = NSColor.clear
|
|
|
- rotateLeftVC?.target = self
|
|
|
- rotateLeftVC?.action = #selector(leftRotationImageAction)
|
|
|
- rotateLeftVC?.image = NSImage(named: "KMImageNameEditPDFRotationLeft")!
|
|
|
- rotateLeftVC?._image_disabled = NSImage(named: "KMImageNameEditPDFRotationLeft")!
|
|
|
- rotateLeftVC?.background_hov = KMAppearance.buttonHoverColor()
|
|
|
- rotateLeftVC?.updateUI()
|
|
|
-
|
|
|
- rotateRightVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
|
|
|
- rotateRightBox.contentView = rotateRightVC?.view
|
|
|
- rotateRightBox.fillColor = NSColor.clear
|
|
|
- rotateRightVC?.target = self
|
|
|
- rotateRightVC?.action = #selector(rightRotationImageAction)
|
|
|
- rotateRightVC?.image = NSImage(named: "KMImageNameEditPDFRotationRight")!
|
|
|
- rotateRightVC?.background_hov = KMAppearance.buttonHoverColor()
|
|
|
- rotateRightVC?.updateUI()
|
|
|
-
|
|
|
- flipHorizontalVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
|
|
|
- flipHorizontalBox.contentView = flipHorizontalVC?.view
|
|
|
- flipHorizontalBox.fillColor = NSColor.clear
|
|
|
- flipHorizontalVC?.target = self
|
|
|
- flipHorizontalVC?.action = #selector(flipHorizontalImageAction)
|
|
|
- flipHorizontalVC?.image = NSImage(named: "KMImageNameEditPDFFlipHorizontal")!
|
|
|
- flipHorizontalVC?.background_hov = KMAppearance.buttonHoverColor()
|
|
|
- flipHorizontalVC?.updateUI()
|
|
|
-
|
|
|
- flipVerticalVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
|
|
|
- flipVerticalBox.contentView = flipVerticalVC?.view
|
|
|
- flipVerticalBox.fillColor = NSColor.clear
|
|
|
- flipVerticalVC?.target = self
|
|
|
- flipVerticalVC?.action = #selector(flipVerticalImageAction)
|
|
|
- flipVerticalVC?.image = NSImage(named: "KMImageNameEditPDFFlipVertical")!
|
|
|
- flipVerticalVC?.background_hov = KMAppearance.buttonHoverColor()
|
|
|
- flipVerticalVC?.updateUI()
|
|
|
+// rotateLeftVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
|
|
|
+//// rotateLeftBox.contentView = rotateLeftVC?.view
|
|
|
+//// rotateLeftBox.fillColor = NSColor.clear
|
|
|
+// rotateLeftVC?.target = self
|
|
|
+// rotateLeftVC?.action = #selector(leftRotationImageAction)
|
|
|
+// rotateLeftVC?.image = NSImage(named: "KMImageNameEditPDFRotationLeft")!
|
|
|
+// rotateLeftVC?._image_disabled = NSImage(named: "KMImageNameEditPDFRotationLeft")!
|
|
|
+// rotateLeftVC?.background_hov = KMAppearance.buttonHoverColor()
|
|
|
+// rotateLeftVC?.updateUI()
|
|
|
+
|
|
|
+// rotateRightVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
|
|
|
+//// rotateRightBox.contentView = rotateRightVC?.view
|
|
|
+//// rotateRightBox.fillColor = NSColor.clear
|
|
|
+// rotateRightVC?.target = self
|
|
|
+// rotateRightVC?.action = #selector(rightRotationImageAction)
|
|
|
+// rotateRightVC?.image = NSImage(named: "KMImageNameEditPDFRotationRight")!
|
|
|
+// rotateRightVC?.background_hov = KMAppearance.buttonHoverColor()
|
|
|
+// rotateRightVC?.updateUI()
|
|
|
+
|
|
|
+// flipHorizontalVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
|
|
|
+//// flipHorizontalBox.contentView = flipHorizontalVC?.view
|
|
|
+//// flipHorizontalBox.fillColor = NSColor.clear
|
|
|
+// flipHorizontalVC?.target = self
|
|
|
+// flipHorizontalVC?.action = #selector(flipHorizontalImageAction)
|
|
|
+// flipHorizontalVC?.image = NSImage(named: "KMImageNameEditPDFFlipHorizontal")!
|
|
|
+// flipHorizontalVC?.background_hov = KMAppearance.buttonHoverColor()
|
|
|
+// flipHorizontalVC?.updateUI()
|
|
|
+
|
|
|
+// flipVerticalVC = KMDesignPropertySelector.init(withType: .Icon_Btn)
|
|
|
+//// flipVerticalBox.contentView = flipVerticalVC?.view
|
|
|
+//// flipVerticalBox.fillColor = NSColor.clear
|
|
|
+// flipVerticalVC?.target = self
|
|
|
+// flipVerticalVC?.action = #selector(flipVerticalImageAction)
|
|
|
+// flipVerticalVC?.image = NSImage(named: "KMImageNameEditPDFFlipVertical")!
|
|
|
+// flipVerticalVC?.background_hov = KMAppearance.buttonHoverColor()
|
|
|
+// flipVerticalVC?.updateUI()
|
|
|
|
|
|
// 设置默认状态下的滑块图像
|
|
|
let customCell = CustomSliderCell()
|
|
@@ -235,6 +371,26 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
opacitySlider.action = #selector(sliderValueChanged(_:))
|
|
|
opacitySlider.isContinuous = false
|
|
|
|
|
|
+ self.turnOverTitleLabel.stringValue = NSLocalizedString("Turn over", comment: "")
|
|
|
+ self.reverseXVC = KMDesignButton(withType: .Image)
|
|
|
+ self.reverseXBox.addSubview(self.reverseXVC!.view)
|
|
|
+ self.reverseXVC?.view.frame = self.reverseXBox.bounds
|
|
|
+ self.reverseXVC?.view.autoresizingMask = [.width, .height]
|
|
|
+ self.reverseXVC?.target = self
|
|
|
+ self.reverseXVC?.action = #selector(flipHorizontalImageAction)
|
|
|
+ self.reverseXVC?.image = NSImage(named: "KMImageNameEditPDFReverseX")!
|
|
|
+ self.reverseXVC?.pagination()
|
|
|
+
|
|
|
+ self.reverseYVC = KMDesignButton(withType: .Image)
|
|
|
+ self.reverseYBox.addSubview(self.reverseYVC!.view)
|
|
|
+ self.reverseYVC?.view.frame = self.reverseXBox.bounds
|
|
|
+ self.reverseYVC?.view.autoresizingMask = [.width, .height]
|
|
|
+ self.reverseYVC?.target = self
|
|
|
+ self.reverseYVC?.action = #selector(flipVerticalImageAction)
|
|
|
+ self.reverseYVC?.image = NSImage(named: "KMImageNameEditPDFReverseY")!
|
|
|
+ self.reverseYVC?.pagination()
|
|
|
+
|
|
|
+ self.toolsTitleLabel.stringValue = NSLocalizedString("Tools", comment: "")
|
|
|
|
|
|
cropVC = KMDesignButton.init(withType: .Text)
|
|
|
cropBox.contentView = cropVC?.view
|
|
@@ -375,19 +531,19 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
self.listView.selectImageAreas = imagesAreas.first
|
|
|
self.headerBox.isHidden = false
|
|
|
self.headerBoxHeight.constant = 176
|
|
|
- self.headerBoxMaginWidthConstraint.constant = 8
|
|
|
- self.imageBox.isHidden = false
|
|
|
- self.imageBoxHeight.constant = 88
|
|
|
+// self.headerBoxMaginWidthConstraint.constant = 8
|
|
|
+// self.imageBox.isHidden = false
|
|
|
+// self.imageBoxHeight.constant = 88
|
|
|
self.opacityBox.isHidden = false
|
|
|
self.opacityBoxHeight.constant = 56
|
|
|
- self.opacityBoxBottomMaginConstraint.constant = 16
|
|
|
+ self.opacityBoxBottomMaginConstraint.constant = 66
|
|
|
self.opacityBoxTopConstraint.constant = 16
|
|
|
self.buttonBox.isHidden = false
|
|
|
// self.cropBox.isHidden = false
|
|
|
// self.cancelBox.isHidden = false
|
|
|
// self.replaceBox.isHidden = false
|
|
|
- self.buttonBoxHeight.constant = 112
|
|
|
- self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
+ self.buttonBoxHeight.constant = 112+16
|
|
|
+// self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
self.alignmentViewTopConstraint.constant = 16
|
|
|
|
|
|
let opacity: CGFloat = self.listView.opacity(for: imagesAreas.first)
|
|
@@ -395,9 +551,9 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
} else if imagesAreas.count > 1 && imagesAreas.count == areas.count { //多选图片
|
|
|
self.headerBox.isHidden = false
|
|
|
self.headerBoxHeight.constant = 82
|
|
|
- self.headerBoxMaginWidthConstraint.constant = 0
|
|
|
- self.imageBox.isHidden = true
|
|
|
- self.imageBoxHeight.constant = 0
|
|
|
+// self.headerBoxMaginWidthConstraint.constant = 0
|
|
|
+// self.imageBox.isHidden = true
|
|
|
+// self.imageBoxHeight.constant = 0
|
|
|
self.opacityBox.isHidden = false
|
|
|
self.opacityBoxHeight.constant = 56
|
|
|
self.opacityBoxBottomMaginConstraint.constant = 0
|
|
@@ -418,13 +574,13 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
self.updateImageAreasOpacity(opacity: opacity, state: .ended, needListView: false)
|
|
|
} else if imagesAreas.count > 0 && imagesAreas.count != areas.count { //多选图片跟文字
|
|
|
self.opacityBoxBottomMaginConstraint.constant = 0
|
|
|
- self.headerBoxMaginWidthConstraint.constant = 0
|
|
|
+// self.headerBoxMaginWidthConstraint.constant = 0
|
|
|
self.alignmentViewTopConstraint.constant = 0
|
|
|
self.opacityBoxTopConstraint.constant = 0
|
|
|
// self.headerBox.isHidden = true
|
|
|
self.headerBoxHeight.constant = 48
|
|
|
- self.imageBox.isHidden = true
|
|
|
- self.imageBoxHeight.constant = 0
|
|
|
+// self.imageBox.isHidden = true
|
|
|
+// self.imageBoxHeight.constant = 0
|
|
|
self.opacityBox.isHidden = true
|
|
|
self.opacityBoxHeight.constant = 0
|
|
|
self.buttonBox.isHidden = true
|
|
@@ -486,10 +642,10 @@ class KMEditImagePropertyViewController: NSViewController {
|
|
|
// self.listView.editingAreas()!.count == 1 &&
|
|
|
if (self.listView.editingAreas()?.first is CPDFEditImageArea) {
|
|
|
self.listView.selectImageAreas = self.listView.editingAreas()!.first as? CPDFEditImageArea
|
|
|
- self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
+// self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
self.opacitySlider.objectValue = self.listView.opacity(for: self.listView.selectImageAreas)
|
|
|
self.opacityVC?.stringValue = Int(opacity * 100).description + "%"
|
|
|
- self.editImageView.alphaValue = opacity
|
|
|
+// self.editImageView.alphaValue = opacity
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -537,6 +693,10 @@ extension KMEditImagePropertyViewController {
|
|
|
self.updateImageAreasOpacity(opacity:CGFloat(sliderValue), state: .changed)
|
|
|
}
|
|
|
|
|
|
+ @objc func whAction(_ sender: AnyObject) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@IBAction func rightRotationImageAction(_ sender: Any) {
|
|
|
if self.listView.editingAreas()?.count ?? 0 < 1 {
|
|
|
return
|
|
@@ -547,7 +707,7 @@ extension KMEditImagePropertyViewController {
|
|
|
let imageArea = areas!.first as! CPDFEditImageArea
|
|
|
self.listView.rotate(with: imageArea, rotate: 90)
|
|
|
self.listView.selectImageAreas = imageArea
|
|
|
- self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
+// self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
} else if areas!.count > 1 {
|
|
|
for imagesArea in imagesAreas {
|
|
|
self.listView.rotate(with: imagesArea, rotate: 90)
|
|
@@ -568,7 +728,7 @@ extension KMEditImagePropertyViewController {
|
|
|
if self.listView.editingAreas()!.count == 1 && (self.listView.editingAreas()!.first is CPDFEditImageArea) {
|
|
|
self.listView.selectImageAreas = self.listView.editingAreas()!.first as? CPDFEditImageArea
|
|
|
}
|
|
|
- self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
+// self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
} else {
|
|
|
for imagesArea in imagesAreas {
|
|
|
self.listView.rotate(with: imagesArea, rotate: -90)
|
|
@@ -589,7 +749,7 @@ extension KMEditImagePropertyViewController {
|
|
|
if item is CPDFEditImageArea {
|
|
|
self.listView.horizontalMirror(with: item as? CPDFEditImageArea)
|
|
|
if areas?.count == 1 {
|
|
|
- self.editImageView.image = (item as AnyObject).thumbnailImage
|
|
|
+// self.editImageView.image = (item as AnyObject).thumbnailImage
|
|
|
}
|
|
|
} else {
|
|
|
for imagesArea in imagesAreas {
|
|
@@ -612,7 +772,7 @@ extension KMEditImagePropertyViewController {
|
|
|
for item in areas! {
|
|
|
if item is CPDFEditImageArea {
|
|
|
self.listView.verticalMirror(with: item as? CPDFEditImageArea)
|
|
|
- self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
+// self.editImageView.image = self.listView.selectImageAreas.thumbnailImage
|
|
|
} else {
|
|
|
for imagesArea in imagesAreas {
|
|
|
self.listView.verticalMirror(with: imagesArea)
|