// zoom到选中的图元
function zoomToActiveRectById(type, id) {
const active = drawingSet.sets[0].viewerDrawing // 修改后图纸
const inActive = drawingSet.sets[1].viewerDrawing // 修改前图纸
const ratio = 0.2
// 选中效果切换
if (type && type !== 'delete') {
active.zoomToObject(id, ratio)
let box = active.getObjectBoundingBox(id)
inActive.getViewer().zoomToWorldBox(box[0], box[1], ratio)
console.log(box[0], box[1], ratio);
} else {
inActive.zoomToObject(id, ratio)
let box = inActive.getObjectBoundingBox(id)
active.getViewer().zoomToWorldBox(box[0], box[1], ratio)
// 针对旧版图纸数据强制更新
if (active.version === '1') {
active.update(true)
inActive.update(true)
}
修改的图元可以正常显示,新增的图元无法显示
求大家帮忙看下是啥问题