更新绘画功能

This commit is contained in:
X1627315083
2024-11-22 09:20:25 +08:00
parent fe3b89d615
commit 5d9dc7b77d
19 changed files with 3643 additions and 565 deletions

View File

@@ -98,10 +98,16 @@ export default defineComponent({
canvasImgData.width = img.width
canvasImgData.height = img.height
let canvasBox = document.querySelector('.liquefaction .liquefaction_canvas_box')
let width = canvasBox.offsetHeight / img.height * img.width
canvas = document.getElementById('c')
let scale = canvasBox.offsetWidth / img.width
let width = canvasBox.offsetWidth
let height = img.height * scale
if(height > canvasBox.offsetHeight){
height = canvasBox.offsetHeight
width = img.width / img.height * height
}
canvas.width = width
canvas.height = canvasBox.offsetHeight
canvas.height = height
let optfor = false
const context = canvas.getContext('2d');
context.drawImage(img, 1, 1, canvas.width, canvas.height);
@@ -351,7 +357,11 @@ export default defineComponent({
text-align: center;
// overflow-x: auto;
position: relative;
overflow-y: hidden;
// overflow-y: hidden;
display: flex;
align-items: center;
overflow: hidden;
justify-content: center;
}
.liquefaction_parameter{
padding-top: 5rem;