|
@@ -76,6 +76,10 @@ class KMPageEditThumbnailItem: NSCollectionViewItem {
|
|
|
self.backgroundView.layer?.borderWidth = 1.0
|
|
|
self.isSelected = false
|
|
|
|
|
|
+ self.pageView.wantsLayer = true
|
|
|
+// self.pageView.layer?.borderWidth = 1
|
|
|
+// self.pageView.layer?.borderColor = NSColor.red.cgColor
|
|
|
+
|
|
|
self.pageTextLabel.font = NSFont.SFProTextRegular(14)
|
|
|
self.pageTextLabel.textColor = NSColor.titleColor()
|
|
|
self.pageSizeTextLabel.font = NSFont.SFProTextRegular(14)
|
|
@@ -173,6 +177,18 @@ class KMPageEditThumbnailItem: NSCollectionViewItem {
|
|
|
if (self.thumbnailView.isShowPageSize == false) {
|
|
|
size = NSMakeSize(backgroundViewW-32, backgroundViewH-72)
|
|
|
}
|
|
|
+
|
|
|
+ if (page.rotation == -90 || page.rotation == -270) {
|
|
|
+ let height = bounds.size.height
|
|
|
+ bounds.size.height = bounds.size.width
|
|
|
+ bounds.size.width = height
|
|
|
+ }
|
|
|
+
|
|
|
+ if (page.rotation == -90 || page.rotation == -270) {
|
|
|
+ let height = size.height
|
|
|
+ size.height = size.width
|
|
|
+ size.width = height
|
|
|
+ }
|
|
|
|
|
|
if bounds.size.width > bounds.size.height {
|
|
|
if (bounds.size.width > 0) {
|
|
@@ -216,7 +232,15 @@ class KMPageEditThumbnailItem: NSCollectionViewItem {
|
|
|
let pageBoxH: CGFloat = viewHeight-pageBoxY-8
|
|
|
self.pageBox.frame = NSMakeRect(margin, pageBoxY, pageBoxW, pageBoxH)
|
|
|
|
|
|
- let pageX: CGFloat = (NSWidth(self.pageBox.frame)-size.width)*0.5
|
|
|
+ var pageX: CGFloat = (NSWidth(self.pageBox.frame)-size.width)*0.5
|
|
|
+ if (pageX < 0) {
|
|
|
+ let tempWidth = size.width + pageX * 2
|
|
|
+ let scale = tempWidth / size.width
|
|
|
+ size.width = size.width * scale
|
|
|
+ size.height = size.height * scale
|
|
|
+
|
|
|
+ pageX = 0
|
|
|
+ }
|
|
|
let pageY: CGFloat = (NSHeight(self.pageBox.frame)-size.height)*0.5
|
|
|
self.pageView.frame = NSMakeRect(pageX, pageY, size.width, size.height)
|
|
|
}
|