| | |
| | | element.fontSize = element.fontSize * sizeradio |
| | | } else if (element.type === 'qrcode') { |
| | | element.qrcodeWidth = element.qrcodeWidth * ratio |
| | | |
| | | if (element.qrcodeWidth > element.height) { |
| | | element.qrcodeWidth = element.height |
| | | } |
| | | if (element.qrcodeWidth > element.width) { |
| | | element.qrcodeWidth = element.width |
| | | } |
| | | } else if (element.type === 'image') { |
| | | element.imgWidth = element.imgWidth * ratio |
| | | element.imgHeight = element.imgHeight * ratio |
| | |
| | | context.translate(-_cx, -_cy) // 恢复原点 |
| | | } |
| | | |
| | | if (debug || selectId === element.uuid) { // 选中元素,设置外部阴影 |
| | | if (selectId === element.uuid) { // 选中元素,设置外部阴影 |
| | | context.shadowBlur = 5 |
| | | context.shadowColor = '#1890ff' |
| | | context.fillStyle = 'white' |
| | | context.fillRect(element.left, element.top, element.width || 1, element.height || 1) |
| | | context.shadowBlur = 0 |
| | | } else if (debug) { |
| | | context.shadowBlur = 3 |
| | | context.shadowColor = 'orange' |
| | | context.fillStyle = 'white' |
| | | context.fillRect(element.left, element.top, element.width || 1, element.height || 1) |
| | | context.shadowBlur = 0 |
| | |
| | | context.fillRect(element.left, element.top, element.width, element.height) |
| | | } |
| | | |
| | | if ((debug || selectId === element.uuid) && element.width > 3 * ratio && element.height > 3 * ratio) { // 选中元素,设置外部阴影 |
| | | if (selectId === element.uuid && element.width > 3 * ratio && element.height > 3 * ratio) { // 选中元素,设置外部阴影 |
| | | context.strokeStyle = '#1890ff' |
| | | context.beginPath() |
| | | context.moveTo(element.left + element.width - 7, element.top + element.height - 2) |
| | |
| | | context.fillStyle = element.fontColor |
| | | |
| | | let lines = element.value.split('\n') |
| | | |
| | | if (!element.value && element.field) { |
| | | if (element.field === 'other_field') { |
| | | lines = [element.cusfield || ''] |
| | | } else { |
| | | lines = [element.field] |
| | | } |
| | | } |
| | | let _y = element.top + element.padding + element.fontSize + element.borderSize |
| | | let _left = element.left + element.borderSize + element.padding |
| | | let _right = element.left + element.width - element.padding - element.borderSize |