|
|
|
@ -908,20 +908,59 @@ function PaintWeb (win, doc) {
|
|
|
|
|
alert(lang.imageLoadDifferentHost);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// FIXME : image size 조정
|
|
|
|
|
// if (imageLoad) {
|
|
|
|
|
// width = parseInt(imageLoad.width);
|
|
|
|
|
// height = parseInt(imageLoad.height);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const imgWidth = parseInt(imageLoad.width);
|
|
|
|
|
const imgHeight = parseInt(imageLoad.height);
|
|
|
|
|
let scaleRate = 1.0;
|
|
|
|
|
|
|
|
|
|
if (imageLoad) {
|
|
|
|
|
width = parseInt(imageLoad.width);
|
|
|
|
|
height = parseInt(imageLoad.height);
|
|
|
|
|
if(imgWidth > width){
|
|
|
|
|
scaleRate = width / imgWidth;
|
|
|
|
|
width = Math.floor(imgWidth * scaleRate);
|
|
|
|
|
height = Math.floor(imgHeight * scaleRate);
|
|
|
|
|
|
|
|
|
|
// viewportHeight": "620px" 설정에 맞게 set
|
|
|
|
|
if(height > 620){
|
|
|
|
|
scaleRate = 620 / height;
|
|
|
|
|
width = Math.floor(width * scaleRate);
|
|
|
|
|
height = Math.floor(height * scaleRate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(imgHeight > height){
|
|
|
|
|
scaleRate = height / imgHeight;
|
|
|
|
|
width = Math.floor(imgWidth * scaleRate);
|
|
|
|
|
height = Math.floor(imgHeight * scaleRate);
|
|
|
|
|
|
|
|
|
|
if(width > cfg.imageWidth){
|
|
|
|
|
scaleRate = cfg.imageWidth / width;
|
|
|
|
|
width = Math.floor(width * scaleRate);
|
|
|
|
|
height = Math.floor(height * scaleRate);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//----------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
res.elem = resInfo;
|
|
|
|
|
|
|
|
|
|
this.image.width = layerCanvas.width = bufferCanvas.width = width;
|
|
|
|
|
this.image.height = layerCanvas.height = bufferCanvas.height = height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.layer.canvas = layerCanvas;
|
|
|
|
|
this.layer.context = layerContext;
|
|
|
|
|
this.buffer.canvas = bufferCanvas;
|
|
|
|
|
this.buffer.context = bufferContext;
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
// FIXME : image size 조정
|
|
|
|
|
this.layer.context.scale(scaleRate, scaleRate);
|
|
|
|
|
//---------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
if (imageLoad) {
|
|
|
|
|
layerContext.drawImage(imageLoad, 0, 0);
|
|
|
|
|