更新绘画功能
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user