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

Unified Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 2867093003: Do not increase the pointer id when type is eraser (Closed)
Patch Set: eraser id Created 3 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/events/PointerEventFactory.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
index 2bbb8654d16dd90a4ce7f35ef1766e82490ffa2c..0d8e5df7ae9ec5f728d0ff244a0430af71f3f458 100644
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -483,20 +483,29 @@ int PointerEventFactory::AddIdAndActiveButtons(const IncomingId p,
return kMouseId;
}
- if (pointer_incoming_id_mapping_.Contains(p)) {
- int mapped_id = pointer_incoming_id_mapping_.at(p);
- pointer_id_mapping_.Set(mapped_id, PointerAttributes(p, is_active_buttons));
+ IncomingId incoming_id = p;
+ if (p.GetPointerType() == WebPointerProperties::PointerType::kEraser) {
dtapuska 2017/05/09 13:24:45 Sorry this seems wrong to me. In that if we get an
+ const IncomingId pen_id =
+ IncomingId(WebPointerProperties::PointerType::kPen, p.RawId());
+ if (pointer_incoming_id_mapping_.Contains(pen_id))
+ incoming_id = pen_id;
+ }
+
+ if (pointer_incoming_id_mapping_.Contains(incoming_id)) {
+ int mapped_id = pointer_incoming_id_mapping_.at(incoming_id);
+ pointer_id_mapping_.Set(mapped_id,
+ PointerAttributes(incoming_id, is_active_buttons));
return mapped_id;
}
- int type_int = p.PointerTypeInt();
+ int type_int = incoming_id.PointerTypeInt();
// We do not handle the overflow of m_currentId as it should be very rare
int mapped_id = current_id_++;
if (!id_count_[type_int])
primary_id_[type_int] = mapped_id;
id_count_[type_int]++;
- pointer_incoming_id_mapping_.insert(p, mapped_id);
+ pointer_incoming_id_mapping_.insert(incoming_id, mapped_id);
pointer_id_mapping_.insert(mapped_id,
- PointerAttributes(p, is_active_buttons));
+ PointerAttributes(incoming_id, is_active_buttons));
return mapped_id;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698