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