Commits

Anonymous committed 61dbfc6

scroll not yet fully functional

Comments (0)

Files changed (4)

 
 @property (nonatomic, readonly) pdftron::PDF::PDFDoc * tronPDFDoc;
 
-
+-(NSRect) makeDocRect;
 
 @end
     [super dealloc];
 }
 
+- (NSRect) makeDocRect {
+    return NSMakeRect(0.0, 0.0, 1200.0, 1200.0);
+}
+
 @end
 }
 
 - (void)drawRect:(NSRect)dirtyRect {
+    NSRect svFrame = [[self superview] frame];
+    NSRect svBound = [[self superview] bounds];
     NSRect rect = [self bounds];
     NSPoint p = rect.origin;
     NSSize s = rect.size;
-    NSLog(@"self bound: x: %0.4f, y: %0.4f, w: %0.4f, h: %0.4f", p.x, p.y, s.width, s.height);
+    NSLog(@"self bound: x: w: %0.4f, h: %0.4f", s.width, s.height);
+    NSLog(@"super frame: x: w: %0.4f, h: %0.4f", svFrame.size.width, svFrame.size.height);
+    NSLog(@"self bound: x: w: %0.4f, h: %0.4f", svBound.size.width, svBound.size.height);
+    NSLog(@"dirtyRect: x: %0.4f, y: %0.4f, w: %0.4f, h: %0.4f", dirtyRect.origin.x, dirtyRect.origin.y, dirtyRect.size.width, dirtyRect.size.height);
+
     if (_tronPDFView->GetDoc()) {
-        _tronPDFView->OnSize((int) s.width, (int) s.height);
+        NSRect oldRect = [self frame];
+        oldRect.size.width = svBound.size.width;
+        [self setFrame: oldRect];
+        [self setBounds: oldRect];
+        
+        _tronPDFView->OnSize((int) [self bounds].size.width, (int) [self bounds].size.height);
         
         const char* bgra = _tronPDFView->GetBuffer();
         if (bgra) {
         _tronPDFView->SetDoc(*(myDoc.tronPDFDoc));
         _tronPDFView->SetRenderBeginProc(beginRendering, NULL);
         _tronPDFView->SetRenderFinishProc(endRendering, NULL);
+        _tronPDFView->SetPageSpacing(10, 10, 20, 10);
+        [self setFrame: [myDoc makeDocRect]];
     }
 }
 

cocoapdf.xcodeproj/quincy.mode1v3

 			<key>Content</key>
 			<dict>
 				<key>PBXProjectModuleGUID</key>
-				<string>246738901206E21200157160</string>
+				<string>24E4BEA112079F7600CA10EA</string>
 				<key>PBXProjectModuleLabel</key>
 				<string>TronPDFView.mm</string>
 				<key>PBXSplitModuleInNavigatorKey</key>
 					<key>Split0</key>
 					<dict>
 						<key>PBXProjectModuleGUID</key>
-						<string>246738991206E28200157160</string>
+						<string>24E4BEA91207A02F00CA10EA</string>
 						<key>PBXProjectModuleLabel</key>
 						<string>TronPDFView.mm</string>
 						<key>_historyCapacity</key>
 						<integer>0</integer>
 						<key>bookmark</key>
-						<string>246738FB1206E8D400157160</string>
+						<string>2472670C1207ADAE001BF4F9</string>
 						<key>history</key>
 						<array>
-							<string>246738C21206E47100157160</string>
-							<string>246738C31206E47100157160</string>
-							<string>246738D51206E61100157160</string>
-							<string>246738D71206E61100157160</string>
-							<string>246738EA1206E76C00157160</string>
-							<string>246738E81206E76900157160</string>
+							<string>24E4BEB81207A0B600CA10EA</string>
+							<string>247266D51207A845001BF4F9</string>
+							<string>247266D61207A845001BF4F9</string>
+							<string>247266D71207A845001BF4F9</string>
+							<string>247266D81207A845001BF4F9</string>
 						</array>
 					</dict>
 					<key>SplitCount</key>
 			<key>Geometry</key>
 			<dict>
 				<key>Frame</key>
-				<string>{{0, 20}, {1003, 601}}</string>
+				<string>{{0, 20}, {808, 502}}</string>
 				<key>PBXModuleWindowStatusBarHidden2</key>
 				<false/>
 				<key>RubberWindowFrame</key>
-				<string>87 110 1003 642 0 0 1280 778 </string>
+				<string>237 231 808 543 0 0 1280 778 </string>
 			</dict>
 		</dict>
 	</array>
 			<key>Layout</key>
 			<array>
 				<dict>
+					<key>BecomeActive</key>
+					<true/>
 					<key>ContentConfiguration</key>
 					<dict>
 						<key>PBXBottomSmartGroupGIDs</key>
 							<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
 							<array>
 								<array>
+									<integer>10</integer>
 									<integer>2</integer>
 									<integer>0</integer>
 								</array>
 							</array>
 							<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
-							<string>{{0, 10}, {352, 445}}</string>
+							<string>{{0, 0}, {352, 445}}</string>
 						</dict>
 						<key>PBXTopSmartGroupGIDs</key>
 						<array/>
 										<key>_historyCapacity</key>
 										<integer>0</integer>
 										<key>bookmark</key>
-										<string>246738FA1206E8D400157160</string>
+										<string>2472670B1207ADAE001BF4F9</string>
 										<key>history</key>
 										<array>
 											<string>241D2A8211FBCBED0067260B</string>
 											<string>247587CE11FD10DB00F243C8</string>
 											<string>2479D4AF11FD2A100022D97A</string>
 											<string>24926A6011FD7BB1000C72BD</string>
-											<string>24247DD311FED53600B478C1</string>
 											<string>24247E1211FED76E00B478C1</string>
 											<string>24204F5811FFEA7D005F35FB</string>
 											<string>24204F7411FFEAFA005F35FB</string>
 											<string>24204F7511FFEAFA005F35FB</string>
 											<string>24204FA111FFEF54005F35FB</string>
-											<string>248C458B1206888100210F73</string>
-											<string>248C45C01206919E00210F73</string>
-											<string>2467386E1206E11D00157160</string>
 											<string>246738851206E1F400157160</string>
-											<string>246738861206E1F400157160</string>
+											<string>24E4BEA71207A02F00CA10EA</string>
+											<string>24E4BECC1207A25400CA10EA</string>
+											<string>24E9E6881207A6ED00CCA218</string>
 										</array>
 									</dict>
 									<key>SplitCount</key>
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 0}, {414, 213}}</string>
+								<string>{{0, 0}, {414, 178}}</string>
 								<key>RubberWindowFrame</key>
 								<string>190 177 788 504 0 0 1280 778 </string>
 							</dict>
 							<key>Module</key>
 							<string>PBXNavigatorGroup</string>
 							<key>Proportion</key>
-							<string>213pt</string>
+							<string>178pt</string>
 						</dict>
 						<dict>
-							<key>BecomeActive</key>
-							<true/>
 							<key>ContentConfiguration</key>
 							<dict>
 								<key>PBXProjectModuleGUID</key>
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 218}, {414, 245}}</string>
+								<string>{{0, 183}, {414, 280}}</string>
 								<key>RubberWindowFrame</key>
 								<string>190 177 788 504 0 0 1280 778 </string>
 							</dict>
 							<key>Module</key>
 							<string>XCDetailModule</string>
 							<key>Proportion</key>
-							<string>245pt</string>
+							<string>280pt</string>
 						</dict>
 					</array>
 					<key>Proportion</key>
 			</array>
 			<key>TableOfContents</key>
 			<array>
-				<string>246738461206DEBF00157160</string>
+				<string>247266BB1207A70A001BF4F9</string>
 				<string>1CE0B1FE06471DED0097A5F4</string>
-				<string>246738471206DEBF00157160</string>
+				<string>247266BC1207A70A001BF4F9</string>
 				<string>1CE0B20306471E060097A5F4</string>
 				<string>1CE0B20506471E060097A5F4</string>
 			</array>
 	<key>PerspectivesBarVisible</key>
 	<false/>
 	<key>PinnedNavigatorIdentifier</key>
-	<string>246738901206E21200157160</string>
+	<string>24E4BEA112079F7600CA10EA</string>
 	<key>ShelfIsVisible</key>
 	<false/>
 	<key>SourceDescription</key>
 	<integer>5</integer>
 	<key>WindowOrderList</key>
 	<array>
-		<string>246738FC1206E8D400157160</string>
-		<string>246738521206DEBF00157160</string>
-		<string>246738531206DEBF00157160</string>
+		<string>2472670D1207ADAE001BF4F9</string>
+		<string>247266C71207A70A001BF4F9</string>
+		<string>247266C81207A70A001BF4F9</string>
+		<string>1C78EAAD065D492600B07095</string>
 		<string>1CD10A99069EF8BA00B06720</string>
+		<string>2492503F11CB2A5D0076F523</string>
 		<string>/Users/quincy/Repositories/CocoaPDF/cocoapdf.xcodeproj</string>
-		<string>2492503F11CB2A5D0076F523</string>
-		<string>1C78EAAD065D492600B07095</string>
-		<string>246738901206E21200157160</string>
+		<string>24E4BEA112079F7600CA10EA</string>
 	</array>
 	<key>WindowString</key>
 	<string>190 177 788 504 0 0 1280 778 </string>
 								<key>PBXProjectModuleGUID</key>
 								<string>1CD0528F0623707200166675</string>
 								<key>PBXProjectModuleLabel</key>
-								<string>TronPDFView.mm</string>
+								<string></string>
 								<key>StatusBarVisibility</key>
 								<true/>
 							</dict>
 							<string>218pt</string>
 						</dict>
 						<dict>
-							<key>BecomeActive</key>
-							<true/>
 							<key>ContentConfiguration</key>
 							<dict>
 								<key>PBXProjectModuleGUID</key>
 			<key>TableOfContents</key>
 			<array>
 				<string>2492503F11CB2A5D0076F523</string>
-				<string>246738491206DEBF00157160</string>
+				<string>247266BE1207A70A001BF4F9</string>
 				<string>1CD0528F0623707200166675</string>
 				<string>XCMainBuildResultsModuleGUID</string>
 			</array>
 			<key>WindowToolGUID</key>
 			<string>2492503F11CB2A5D0076F523</string>
 			<key>WindowToolIsVisible</key>
-			<true/>
+			<false/>
 		</dict>
 		<dict>
 			<key>FirstTimeWindowDisplayed</key>
 			<key>TableOfContents</key>
 			<array>
 				<string>1CD10A99069EF8BA00B06720</string>
-				<string>2467384A1206DEBF00157160</string>
+				<string>247266BF1207A70A001BF4F9</string>
 				<string>1C162984064C10D400B95A72</string>
-				<string>2467384B1206DEBF00157160</string>
-				<string>2467384C1206DEBF00157160</string>
-				<string>2467384D1206DEBF00157160</string>
-				<string>2467384E1206DEBF00157160</string>
-				<string>2467384F1206DEBF00157160</string>
+				<string>247266C01207A70A001BF4F9</string>
+				<string>247266C11207A70A001BF4F9</string>
+				<string>247266C21207A70A001BF4F9</string>
+				<string>247266C31207A70A001BF4F9</string>
+				<string>247266C41207A70A001BF4F9</string>
 			</array>
 			<key>ToolbarConfiguration</key>
 			<string>xcode.toolbar.config.debugV3</string>
 							<key>GeometryConfiguration</key>
 							<dict>
 								<key>Frame</key>
-								<string>{{0, 0}, {568, 364}}</string>
+								<string>{{0, 0}, {641, 397}}</string>
 								<key>RubberWindowFrame</key>
-								<string>630 304 568 405 0 0 1280 778 </string>
+								<string>630 271 641 438 0 0 1280 778 </string>
 							</dict>
 							<key>Module</key>
 							<string>PBXDebugCLIModule</string>
 							<key>Proportion</key>
-							<string>364pt</string>
+							<string>397pt</string>
 						</dict>
 					</array>
 					<key>Proportion</key>
-					<string>364pt</string>
+					<string>397pt</string>
 				</dict>
 			</array>
 			<key>Name</key>
 			<key>TableOfContents</key>
 			<array>
 				<string>1C78EAAD065D492600B07095</string>
-				<string>246738501206DEBF00157160</string>
+				<string>247266C51207A70A001BF4F9</string>
 				<string>1C78EAAC065D492600B07095</string>
 			</array>
 			<key>ToolbarConfiguration</key>
 			<string>xcode.toolbar.config.consoleV3</string>
 			<key>WindowString</key>
-			<string>630 304 568 405 0 0 1280 778 </string>
+			<string>630 271 641 438 0 0 1280 778 </string>
 			<key>WindowToolGUID</key>
 			<string>1C78EAAD065D492600B07095</string>
 			<key>WindowToolIsVisible</key>
-			<true/>
+			<false/>
 		</dict>
 		<dict>
 			<key>Identifier</key>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.