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

Unified Diff: Source/devtools/front_end/timeline/Layers3DView.js

Issue 312193002: DevTools: Fix bug with context menu in Layers3DView. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove comments. Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/Layers3DView.js
diff --git a/Source/devtools/front_end/timeline/Layers3DView.js b/Source/devtools/front_end/timeline/Layers3DView.js
index 5fb772a32bedc8b9f5f521ba4a765ef4ab47a49a..64f16fa447c57e86d671f21699ffa0602e1a92e0 100644
--- a/Source/devtools/front_end/timeline/Layers3DView.js
+++ b/Source/devtools/front_end/timeline/Layers3DView.js
@@ -595,7 +595,7 @@ WebInspector.Layers3DView.prototype = {
* @param {?Event} event
* @return {?WebInspector.Layers3DView.ActiveObject}
*/
- _layerFromEventPoint: function(event)
+ _activeObjectFromEventPoint: function(event)
{
if (!this._layerTree)
return null;
@@ -638,8 +638,8 @@ WebInspector.Layers3DView.prototype = {
*/
_onContextMenu: function(event)
{
- var layer = this._layerFromEventPoint(event).layer;
- var node = layer ? layer.nodeForSelfOrAncestor() : null;
+ var activeObject = this._activeObjectFromEventPoint(event);
+ var node = activeObject && activeObject.layer && activeObject.layer.nodeForSelfOrAncestor();
var contextMenu = new WebInspector.ContextMenu(event);
contextMenu.appendItem("Reset view", this._transformController._resetAndNotify.bind(this._transformController), false);
if (node)
@@ -654,7 +654,7 @@ WebInspector.Layers3DView.prototype = {
{
if (event.which)
return;
- this.dispatchEventToListeners(WebInspector.Layers3DView.Events.ObjectHovered, this._layerFromEventPoint(event));
+ this.dispatchEventToListeners(WebInspector.Layers3DView.Events.ObjectHovered, this._activeObjectFromEventPoint(event));
},
/**
@@ -673,7 +673,7 @@ WebInspector.Layers3DView.prototype = {
{
const maxDistanceInPixels = 6;
if (this._mouseDownX && Math.abs(event.clientX - this._mouseDownX) < maxDistanceInPixels && Math.abs(event.clientY - this._mouseDownY) < maxDistanceInPixels)
- this.dispatchEventToListeners(WebInspector.Layers3DView.Events.ObjectSelected, this._layerFromEventPoint(event));
+ this.dispatchEventToListeners(WebInspector.Layers3DView.Events.ObjectSelected, this._activeObjectFromEventPoint(event));
delete this._mouseDownX;
delete this._mouseDownY;
},
@@ -683,7 +683,7 @@ WebInspector.Layers3DView.prototype = {
*/
_onDoubleClick: function(event)
{
- var object = this._layerFromEventPoint(event);
+ var object = this._activeObjectFromEventPoint(event);
if (object && object.layer)
this.dispatchEventToListeners(WebInspector.Layers3DView.Events.LayerSnapshotRequested, object.layer);
event.stopPropagation();
« 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