@@ -101,13 +101,37 @@ struct DetailItemSection: Hashable {
101101 var blue : CGFloat = 0
102102 var alpha : CGFloat = 0
103103 nsColor? . getRed ( & red, green: & green, blue: & blue, alpha: & alpha)
104-
104+
105105 items. append ( DetailItemSection ( sectionHeader: " Color Attributes " , items: [
106106 DetailItem ( primaryText: " Red " , secondaryText: Int ( red * 255 ) ) ,
107107 DetailItem ( primaryText: " Green " , secondaryText: Int ( green * 255 ) ) ,
108108 DetailItem ( primaryText: " Blue " , secondaryText: Int ( blue * 255 ) ) ,
109109 ] ) )
110110
111+ case . svg, . pdf:
112+ items. append ( DetailItemSection ( sectionHeader: " Base Attributes " , items: [
113+ DetailItem ( primaryText: " Rendition Name " , secondaryText: cuiRend. name ( ) ) ,
114+ DetailItem ( primaryText: " Lookup Name " , secondaryText: namedLookup. name) ,
115+ sizeOnDisk,
116+ ] ) )
117+ var size = CGSizeZero
118+ switch rendition. type {
119+ case . svg:
120+ if let svgDoc = cuiRend. svgDocument ( ) {
121+ size = CGSVGDocumentGetCanvasSize ( svgDoc)
122+ }
123+ case . pdf:
124+ if let pdfDoc = cuiRend. pdfDocument ( ) ? . takeUnretainedValue ( ) , let page = pdfDoc. page ( at: 1 ) {
125+ size = page. getBoxRect ( . artBox) . size
126+ }
127+ default :
128+ break
129+ }
130+ items. append ( DetailItemSection ( sectionHeader: " Dimensions " , items: [
131+ DetailItem ( primaryText: " Width " , secondaryText: size. width) ,
132+ DetailItem ( primaryText: " Height " , secondaryText: size. height) ,
133+ ] ) )
134+
111135 default :
112136 items. append ( DetailItemSection ( sectionHeader: " Base Attributes " , items: [
113137 DetailItem ( primaryText: " Rendition Name " , secondaryText: cuiRend. name ( ) ) ,
0 commit comments