From 577f085130094efc3b64f4acc29f78bfd274126b Mon Sep 17 00:00:00 2001 From: Curly Brackets <76864176+curly210102@users.noreply.github.com> Date: Thu, 25 Apr 2024 15:47:25 +0800 Subject: [PATCH] fix: click series can not be triggered in mobile dataIndex updated with mousemove, but there without mousemove step in mobile. solution: update dataIndex when mousedown --- src/component/common/Geo3DBuilder.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/component/common/Geo3DBuilder.js b/src/component/common/Geo3DBuilder.js index 72649f53..5b314d8d 100644 --- a/src/component/common/Geo3DBuilder.js +++ b/src/component/common/Geo3DBuilder.js @@ -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) { @@ -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) {