Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 2959813003: PDF: Selection Invalidation should compensate for rounding errors. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 8a12c36f5109e5682128ddad48af8418d3240e55..e96f88ac5ebbcf8da89be7b47ef128d7e4cb948a 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -3291,13 +3291,13 @@ PDFiumEngine::SelectionChangeInvalidator::~SelectionChangeInvalidator() {
bool selection_changed = false;
for (const auto& old_selection : old_selections_) {
if (!old_selection.IsEmpty()) {
- engine_->client_->Invalidate(old_selection);
+ Invalidate(old_selection);
selection_changed = true;
}
}
for (const auto& new_selection : new_selections) {
if (!new_selection.IsEmpty()) {
- engine_->client_->Invalidate(new_selection);
+ Invalidate(new_selection);
selection_changed = true;
}
}
@@ -3321,6 +3321,13 @@ PDFiumEngine::SelectionChangeInvalidator::GetVisibleSelections() const {
return rects;
}
+void PDFiumEngine::SelectionChangeInvalidator::Invalidate(
+ const pp::Rect& selection) {
+ pp::Rect expanded_selection = selection;
+ expanded_selection.Inset(-1, -1);
+ engine_->client_->Invalidate(expanded_selection);
+}
+
PDFiumEngine::MouseDownState::MouseDownState(
const PDFiumPage::Area& area,
const PDFiumPage::LinkTarget& target)
« no previous file with comments | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698