From 391fb2c277943f160340b186af9946698063bd22 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Tue, 21 Jul 2020 12:00:10 +0800 Subject: [PATCH 1/2] chore: update version --- package.json | 3 ++- packages/boundary/package.json | 3 ++- packages/component/package.json | 3 ++- packages/core/package.json | 3 ++- packages/draw/package.json | 3 ++- packages/l7/package.json | 3 ++- packages/l7/src/version.ts | 2 +- packages/layers/package.json | 3 ++- packages/maps/package.json | 3 ++- packages/react/package.json | 3 ++- packages/renderer/package.json | 3 ++- packages/scene/package.json | 3 ++- packages/source/package.json | 3 ++- packages/three/package.json | 3 ++- packages/utils/package.json | 3 ++- 15 files changed, 29 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 09005a3721..c2e300c3ad 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,8 @@ "bundle-dev": "cross-env BABEL_ENV=bundle node_modules/.bin/rollup -c ./build/rollup.config.js --environment 'BUILD:production,MINIFY:false'", "bundle:watch": "cross-env BABEL_ENV=bundle node_modules/.bin/rollup -c ./build/rollup.config.js --watch", "glsl-minify": "node_modules/.bin/glsl-minifier -i ./build/example.frag -o ./build/example.min.frag", - "clean": "lerna run clean" + "clean": "lerna run clean", + "sync": "lerna run sync" }, "workspaces": [ "packages/*", diff --git a/packages/boundary/package.json b/packages/boundary/package.json index dc7e9f0f05..05ea4cb936 100644 --- a/packages/boundary/package.json +++ b/packages/boundary/package.json @@ -31,7 +31,8 @@ "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:cdn": "node_modules/.bin/rollup -c", - "test": "jest" + "test": "jest", + "sync": "tnpm sync" }, "dependencies": { "@antv/l7": "2.2.24", diff --git a/packages/component/package.json b/packages/component/package.json index ce36ca0003..a4292ff72b 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -19,7 +19,8 @@ "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "lint:ts": "run-p -c lint:ts-*", - "test": "jest" + "test": "jest", + "sync": "tnpm sync" }, "author": "lzxue", "license": "ISC", diff --git a/packages/core/package.json b/packages/core/package.json index b4a82e1bad..c84578f495 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -17,7 +17,8 @@ "build": "run-p build:*", "build:cjs": "cross-env BABEL_ENV=cjs NODE_ENV=production babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:esm": "cross-env BABEL_ENV=esm NODE_ENV=production babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", - "watch": "cross-env BABEL_ENV=cjs NODE_ENV=production babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments" + "watch": "cross-env BABEL_ENV=cjs NODE_ENV=production babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", + "sync": "tnpm sync" }, "author": "xiaoiver", "license": "ISC", diff --git a/packages/draw/package.json b/packages/draw/package.json index ff1bcd4cd8..29a80d0629 100644 --- a/packages/draw/package.json +++ b/packages/draw/package.json @@ -32,7 +32,8 @@ "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:cdn": "node_modules/.bin/rollup -c", "lint:ts": "run-p -c lint:ts-*", - "test": "jest" + "test": "jest", + "sync": "tnpm sync" }, "dependencies": { "@antv/l7": "2.2.24", diff --git a/packages/l7/package.json b/packages/l7/package.json index 477a591287..649e6e2b00 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -19,7 +19,8 @@ "build": "run-p build:*", "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", - "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments" + "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", + "sync": "tnpm sync" }, "author": "antv", "license": "MIT", diff --git a/packages/l7/src/version.ts b/packages/l7/src/version.ts index 082c98c34c..e75f19322a 100644 --- a/packages/l7/src/version.ts +++ b/packages/l7/src/version.ts @@ -1,2 +1,2 @@ -const version = '2.2.23'; +const version = '2.2.24'; export { version }; diff --git a/packages/layers/package.json b/packages/layers/package.json index 45c560423c..396fd0645d 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -17,7 +17,8 @@ "build": "run-p build:*", "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", - "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments" + "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", + "sync": "tnpm sync" }, "author": "xiaoiver", "license": "ISC", diff --git a/packages/maps/package.json b/packages/maps/package.json index 4970c61f4c..771dbe5b4e 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -20,7 +20,8 @@ "build": "run-p build:*", "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", - "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments" + "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", + "sync": "tnpm sync" }, "author": "xiaoiver", "license": "ISC", diff --git a/packages/react/package.json b/packages/react/package.json index 1af5ccde34..4803eaa117 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -19,7 +19,8 @@ "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "lint:ts": "run-p -c lint:ts-*", - "test": "jest" + "test": "jest", + "sync": "tnpm sync" }, "author": "lzxue", "license": "ISC", diff --git a/packages/renderer/package.json b/packages/renderer/package.json index ef23c3280f..5136182487 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -17,7 +17,8 @@ "build": "run-p build:*", "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", - "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments" + "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", + "sync": "tnpm sync" }, "author": "xiaoiver", "license": "ISC", diff --git a/packages/scene/package.json b/packages/scene/package.json index cb9daa824e..77e7501582 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -17,7 +17,8 @@ "build": "run-p build:*", "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", - "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments" + "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", + "sync": "tnpm sync" }, "author": "xiaoiver", "license": "ISC", diff --git a/packages/source/package.json b/packages/source/package.json index a48022a4e5..566529c551 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -19,7 +19,8 @@ "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "lint:ts": "run-p -c lint:ts-*", - "test": "jest" + "test": "jest", + "sync": "tnpm sync" }, "author": "lzxue", "license": "ISC", diff --git a/packages/three/package.json b/packages/three/package.json index eea4e236d7..eddc25af4a 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -36,7 +36,8 @@ "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:cdn": "node_modules/.bin/rollup -c", "lint:ts": "run-p -c lint:ts-*", - "test": "jest" + "test": "jest", + "sync": "tnpm sync" }, "bugs": { "url": "https://github.com/antvis/L7/issues" diff --git a/packages/utils/package.json b/packages/utils/package.json index 2c8426302a..31be18c781 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -17,7 +17,8 @@ "build": "run-p build:*", "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", - "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments" + "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments", + "sync": "tnpm sync" }, "author": "lzxue", "license": "ISC", From 44393109576ffd6933b7ab4131a778ebfeaf7703 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Tue, 21 Jul 2020 19:00:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(interaction):=20=E9=AB=98=E5=88=86?= =?UTF-8?q?=E5=B1=8F=E6=8B=BE=E5=8F=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/src/services/interaction/PickingService.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/core/src/services/interaction/PickingService.ts b/packages/core/src/services/interaction/PickingService.ts index 459293de29..21004e0c18 100644 --- a/packages/core/src/services/interaction/PickingService.ts +++ b/packages/core/src/services/interaction/PickingService.ts @@ -48,10 +48,12 @@ export default class PickingService implements IPickingService { getViewportSize, getContainer, } = this.rendererService; - const { + let { width, height, } = (getContainer() as HTMLElement).getBoundingClientRect(); + width *= window.devicePixelRatio; + height *= window.devicePixelRatio; this.pickBufferScale = this.configService.getSceneConfig(id).pickBufferScale || 1; // 创建 picking framebuffer,后续实时 resize @@ -86,10 +88,12 @@ export default class PickingService implements IPickingService { clear, getContainer, } = this.rendererService; - const { + let { width, height, } = (getContainer() as HTMLElement).getBoundingClientRect(); + width *= window.devicePixelRatio; + height *= window.devicePixelRatio; if (this.width !== width || this.height !== height) { this.pickingFBO.resize({ width: Math.round(width / this.pickBufferScale), @@ -125,10 +129,12 @@ export default class PickingService implements IPickingService { ) => { let isPicked = false; const { getViewportSize, readPixels, getContainer } = this.rendererService; - const { + let { width, height, } = (getContainer() as HTMLElement).getBoundingClientRect(); + width *= window.devicePixelRatio; + height *= window.devicePixelRatio; const { enableHighlight, enableSelect } = layer.getLayerConfig(); const xInDevicePixel = x * window.devicePixelRatio;