[poppler] poppler/poppler: TextOutputDev.cc,1.3,1.4

Kristian Hogsberg krh at freedesktop.org
Fri Jul 8 14:59:43 EST 2005


Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv22526/poppler

Modified Files:
	TextOutputDev.cc 
Log Message:
2005-07-08  Kristian Høgsberg  <krh at redhat.com>

        * glib/poppler-page.cc (poppler_page_set_selection_alpha): Add
        this function to initialize the alpha channel when using the
        splash backend.

        * poppler/TextOutputDev.cc (visitLine): Add missing scaling of
        intra-line selection edges.



Index: TextOutputDev.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/TextOutputDev.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- TextOutputDev.cc	1 Jul 2005 04:57:49 -0000	1.3
+++ TextOutputDev.cc	8 Jul 2005 04:59:41 -0000	1.4
@@ -3111,19 +3111,22 @@
   int i;
 
   margin = (line->yMax - line->yMin) / 8;
-  x1 = floor (line->xMax * scale);
-  y1 = floor ((line->yMin - margin) * scale);
-  x2 = ceil (line->xMin * scale);
-  y2 = ceil ((line->yMax + margin) * scale);
+  x1 = line->xMax;
+  y1 = line->yMin - margin;
+  x2 = line->xMin;
+  y2 = line->yMax + margin;
 
   for (i = 0; i < line->len; i++) {
     if (selection->x1 < line->edge[i + 1] && line->edge[i] < x1)
-      x1 = floor (line->edge[i]);
+      x1 = line->edge[i];
     if (line->edge[i] < selection->x2)
-      x2 = ceil (line->edge[i + 1]);
+      x2 = line->edge[i + 1];
   }
 
-  rect = new PDFRectangle (x1, y1, x2, y2);
+  rect = new PDFRectangle (floor (x1 * scale), 
+			   floor (y1 * scale),
+			   ceil (x2 * scale),
+			   ceil (y2 * scale));
   list->append (rect);
 }
 



More information about the poppler mailing list