Skip to content

Commit

Permalink
fix: click series can not be triggered in mobile
Browse files Browse the repository at this point in the history
dataIndex updated with mousemove, but there without mousemove step in
mobile. solution: update dataIndex when mousedown
  • Loading branch information
curly210102 committed Apr 25, 2024
1 parent da7763b commit 577f085
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/component/common/Geo3DBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ Geo3DBuilder.prototype = {

polygonMesh.on('mousemove', this._onmousemove, this);
polygonMesh.on('mouseout', this._onmouseout, this);
polygonMesh.on('mousedown', this._onmousedown, this);
},

_updateDebugWireframe: function (componentModel) {
Expand All @@ -342,6 +343,15 @@ Geo3DBuilder.prototype = {
}
},

_onmousedown: function (e) {
var dataIndex = this._dataIndexOfVertex[e.triangle[0]];
if (dataIndex == null) {
dataIndex = -1;
}
this._lastHoverDataIndex = dataIndex;
this._polygonMesh.dataIndex = dataIndex;
},

_onmousemove: function (e) {
var dataIndex = this._dataIndexOfVertex[e.triangle[0]];
if (dataIndex == null) {
Expand Down

0 comments on commit 577f085

Please sign in to comment.