Chromium Code Reviews| 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; |
| } |