|
|
@@ -95,6 +95,8 @@
|
|
|
const tipShow = ref(false);
|
|
|
const disabledSet = ref(false);
|
|
|
|
|
|
+ const cameraIconSize = { width: 52, height: 52 };
|
|
|
+
|
|
|
//标签
|
|
|
const layer = ref();
|
|
|
const transformer = ref();
|
|
|
@@ -232,8 +234,8 @@
|
|
|
const existingCamera = cameras.value.find((camera) => camera.id === id);
|
|
|
if (existingCamera) return;
|
|
|
const config = {
|
|
|
- width: 52,
|
|
|
- height: 37,
|
|
|
+ width: cameraIconSize.width,
|
|
|
+ height: cameraIconSize.height,
|
|
|
image: camImg,
|
|
|
name: 'image',
|
|
|
id: id,
|
|
|
@@ -406,6 +408,16 @@
|
|
|
layout.cameraList = layout.cameraList
|
|
|
?.map((item) => {
|
|
|
item.config.image = camImg;
|
|
|
+ const width = item.config.width;
|
|
|
+ const height = item.config.height;
|
|
|
+ const ratio = width / height;
|
|
|
+ /** 老版本的相机icon比例在1.4左右,新icon已经更新,比例是1:1,为了避免新icon渲染出来变形,需要调整icon大小
|
|
|
+ * 如果图标的比例在该范围,那么会将它设置为新图标的icon大小 */
|
|
|
+ if (1.3 < ratio && ratio < 1.5) {
|
|
|
+ item.config.width = cameraIconSize.width;
|
|
|
+ item.config.height = cameraIconSize.height;
|
|
|
+ }
|
|
|
+
|
|
|
return item;
|
|
|
})
|
|
|
?.filter((cam) => {
|