|
|
|
@ -948,28 +948,44 @@ function PaintWeb (win, doc) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// FIXME : image size 조정 - start
|
|
|
|
|
// FIXME : image size scale 조정 - start
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
let scaleRate = 1.0;
|
|
|
|
|
|
|
|
|
|
let imgWidth = parseInt(imageLoad.width);
|
|
|
|
|
let imgHeight = parseInt(imageLoad.height);
|
|
|
|
|
const cfgImgWidth = cfg.imageWidth;
|
|
|
|
|
const cfgImgHeight = cfg.imageHeight;
|
|
|
|
|
const calWidth = imgWidth - cfgImgWidth;
|
|
|
|
|
const calHeight = imgHeight -cfgImgHeight;
|
|
|
|
|
|
|
|
|
|
if(imgWidth > width) {
|
|
|
|
|
scaleRate = width / imgWidth;
|
|
|
|
|
imgHeight = Math.floor(imgHeight * scaleRate);
|
|
|
|
|
}
|
|
|
|
|
// viewportHeight": "620px" 설정에 맞게 set
|
|
|
|
|
if(imgHeight > 620){
|
|
|
|
|
scaleRate = scaleRate * (620 / imgHeight);
|
|
|
|
|
|
|
|
|
|
if(calWidth > calHeight) {
|
|
|
|
|
if (imgWidth > cfgImgWidth) {
|
|
|
|
|
scaleRate = cfgImgWidth / imgWidth;
|
|
|
|
|
imgHeight = Math.floor(imgHeight * scaleRate);
|
|
|
|
|
}
|
|
|
|
|
// viewportHeight": "620px" 설정에 맞게 set
|
|
|
|
|
if (imgHeight > cfgImgHeight) {
|
|
|
|
|
scaleRate = scaleRate * (cfgImgHeight / imgHeight);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if (imgHeight > cfgImgHeight) {
|
|
|
|
|
scaleRate = cfgImgHeight / imgHeight;
|
|
|
|
|
imgWidth = Math.floor(imgWidth * scaleRate);
|
|
|
|
|
}
|
|
|
|
|
// viewportHeight": "620px" 설정에 맞게 set
|
|
|
|
|
if (imgWidth > cfgImgWidth) {
|
|
|
|
|
scaleRate = scaleRate * (cfgImgWidth / imgWidth);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.image.zoom = MathRound(scaleRate * 10) / 10;
|
|
|
|
|
//this.imageZoomTo(0.1);
|
|
|
|
|
scaleRate = scaleRate.toFixed(2);
|
|
|
|
|
console.log('>>>>>>>>initCanvas', imageLoad.width*scaleRate, imageLoad.height*scaleRate, scaleRate)
|
|
|
|
|
|
|
|
|
|
//pwlib.inputs.imageZoom.value = 40;
|
|
|
|
|
//pwlib.initImageZoom();
|
|
|
|
|
this.image.zoom = scaleRate;
|
|
|
|
|
//this.imageZoomTo(scaleRate)
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// FIXME : image size 조정 - end
|
|
|
|
|
// FIXME : image size scale 조정 - end
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|