Commit eaccfcfd by Kim Eunchul

#41178【課題5】[TTSSBiz Web]PDF閲覧時障害

parent 8f029a2a
......@@ -4781,16 +4781,14 @@ CONTENTVIEW.flip = function(opt) {
if (CONTENTVIEW.srcRect.left < 0) {
CONTENTVIEW.srcRect.left = 0;
CONTENTVIEW.srcRect.right = CONTENTVIEW.srcRect.left + CONTENTVIEW.srcRect.width;
}
if (CONTENTVIEW.srcRect.right > offscreen.width) {
} else if (CONTENTVIEW.srcRect.right > offscreen.width) {
CONTENTVIEW.srcRect.left = offscreen.width - CONTENTVIEW.srcRect.width;
CONTENTVIEW.srcRect.right = offscreen.width;
}
if (CONTENTVIEW.srcRect.top < 0) {
CONTENTVIEW.srcRect.top = 0;
CONTENTVIEW.srcRect.bottom = CONTENTVIEW.srcRect.top + CONTENTVIEW.srcRect.height;
}
if (CONTENTVIEW.srcRect.bottom > offscreen.height) {
} else if (CONTENTVIEW.srcRect.bottom > offscreen.height) {
CONTENTVIEW.srcRect.top = offscreen.height - CONTENTVIEW.srcRect.height;
CONTENTVIEW.srcRect.bottom = offscreen.height;
}
......@@ -5124,32 +5122,53 @@ CONTENTVIEW.flip = function(opt) {
context.translate(-(canvas.width/2),-(canvas.height/2));
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
//if(w > width) w = width;
//if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
try {
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
} catch (error) {
if(w > width) w = width;
if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
}
}else{
context.translate(canvas.width/2,canvas.height/2);
context.rotate($(rotatebtnR).attr('angle')*Math.PI/180);
context.translate(-(canvas.width/2),-(canvas.height/2));
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
//if(w > width) w = width;
// if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, width, height);
try {
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
} catch (error) {
if(w > width) w = width;
if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
}
}
}else{
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
// if(w > width) w = width;
// if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, width, height);
}
try {
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
} catch (error) {
if(w > width) w = width;
if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
}
}
context.restore();
}
else if(opt==2){
......@@ -5314,26 +5333,53 @@ CONTENTVIEW.flip = function(opt) {
context.translate(-(canvas.width/2),-(canvas.height/2));
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
try {
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
} catch (error) {
if(w > width) w = width;
if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
}
}else{
context.translate(canvas.width/2,canvas.height/2);
context.rotate($(rotatebtnR).attr('angle')*Math.PI/180);
context.translate(-(canvas.width/2),-(canvas.height/2));
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, width, height);
try {
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
} catch (error) {
if(w > width) w = width;
if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
}
}
}else{
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, width, height);
}
try {
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
} catch (error) {
if(w > width) w = width;
if(h > height) h = height;
context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
}
}
context.restore();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment