[poppler] poppler/TextOutputDev.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Thu Jul 18 01:39:03 PDT 2013


 poppler/TextOutputDev.cc |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 6cf43442e38c501b49293a28f38e06ab143852c6
Author: Ed Catmur <ed at catmur.co.uk>
Date:   Thu Jul 18 10:34:29 2013 +0200

    TextOutputDev: clip the selected text rendering to the selection box
    
    Sometimes with italic text or text containing ligatures, part of the
    glyph falls outside the selection box. By clipping to the selection box
    we avoid drawing the whole glyph with the selection color.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=66983

diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index 5efb5c3..eeea6f7 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -4364,6 +4364,10 @@ void TextSelectionPainter::visitWord (TextWord *word, int begin, int end,
 void TextSelectionPainter::endPage()
 {
   out->fill(state);
+
+  out->saveState(state);
+  out->clip(state);
+
   state->clearPath();
 
   state->setFillColor(glyph_color);
@@ -4405,6 +4409,7 @@ void TextSelectionPainter::endPage()
     }
   }
 
+  out->restoreState(state);
   out->endPage ();
 }
 


More information about the poppler mailing list