Revision: 4191
http://skim-app.svn.sourceforge.net/skim-app/?rev=4191&view=rev
Author: hofman
Date: 2008-07-11 11:51:45 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
Offset page index for synctex parser properly
Modified Paths:
--------------
trunk/SKPDFSynchronizer.m
Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m 2008-07-11 18:25:17 UTC (rev 4190)
+++ trunk/SKPDFSynchronizer.m 2008-07-11 18:51:45 UTC (rev 4191)
@@ -602,7 +602,7 @@
- (BOOL)synctexFindLine:(int *)line file:(NSString **)file
forLocation:(NSPoint)point inRect:(NSRect)rect atPageIndex:(unsigned
int)pageIndex {
#ifdef SYNCTEX_FEATURE
- if (synctex_edit_query(scanner, (int)pageIndex - 1, PDF_TO_SYNC(point.x),
PDF_TO_SYNC(point.y)) > 0) {
+ if (synctex_edit_query(scanner, (int)pageIndex + 1, PDF_TO_SYNC(point.x),
PDF_TO_SYNC(point.y)) > 0) {
synctex_node_t node;
if (node = synctex_next_result(scanner)) {
*line = synctex_node_line(node);
@@ -619,7 +619,8 @@
if (synctex_display_query(scanner, [file fileSystemRepresentation], line,
0) > 0) {
synctex_node_t node;
if ((node = synctex_next_result(scanner))) {
- *pageIndex = synctex_node_page(node) + 1;
+ unsigned int page = synctex_node_page(node);
+ *pageIndex = page > 0 ? page - 1 : page;
*point = NSMakePoint(SYNC_TO_PDF(synctex_node_h(node)),
SYNC_TO_PDF(synctex_node_v(node)));
return YES;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit