修复新版chrome场景树不显示问题,优化标记位置功能

This commit is contained in:
next
2019-12-21 21:02:27 +08:00
parent 0eb78550f6
commit caf54f3d04
5 changed files with 217 additions and 219 deletions

View File

@@ -519,10 +519,10 @@ let app = new Vue({
let borderNode = new cc.Node();
let bgNode = new cc.Node();
let graphics = bgNode.addComponent(cc.Graphics);
let canvas = cc.find('Canvas');
canvas.addChild(bgNode);
let scene = cc.director.getScene();
scene.addChild(bgNode);
bgNode.addChild(borderNode);
bgNode.position = canvas.convertToNodeSpaceAR(rect.center);
bgNode.position = scene.convertToNodeSpaceAR(rect.center);
let isZeroSize = rect.width === 0 || rect.height === 0;
if (isZeroSize) {
graphics.circle(0, 0, 100);