Commit eaccfcfd by Kim Eunchul

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

parent 8f029a2a
...@@ -4781,16 +4781,14 @@ CONTENTVIEW.flip = function(opt) { ...@@ -4781,16 +4781,14 @@ CONTENTVIEW.flip = function(opt) {
if (CONTENTVIEW.srcRect.left < 0) { if (CONTENTVIEW.srcRect.left < 0) {
CONTENTVIEW.srcRect.left = 0; CONTENTVIEW.srcRect.left = 0;
CONTENTVIEW.srcRect.right = CONTENTVIEW.srcRect.left + CONTENTVIEW.srcRect.width; CONTENTVIEW.srcRect.right = CONTENTVIEW.srcRect.left + CONTENTVIEW.srcRect.width;
} } else if (CONTENTVIEW.srcRect.right > offscreen.width) {
if (CONTENTVIEW.srcRect.right > offscreen.width) {
CONTENTVIEW.srcRect.left = offscreen.width - CONTENTVIEW.srcRect.width; CONTENTVIEW.srcRect.left = offscreen.width - CONTENTVIEW.srcRect.width;
CONTENTVIEW.srcRect.right = offscreen.width; CONTENTVIEW.srcRect.right = offscreen.width;
} }
if (CONTENTVIEW.srcRect.top < 0) { if (CONTENTVIEW.srcRect.top < 0) {
CONTENTVIEW.srcRect.top = 0; CONTENTVIEW.srcRect.top = 0;
CONTENTVIEW.srcRect.bottom = CONTENTVIEW.srcRect.top + CONTENTVIEW.srcRect.height; CONTENTVIEW.srcRect.bottom = CONTENTVIEW.srcRect.top + CONTENTVIEW.srcRect.height;
} } else if (CONTENTVIEW.srcRect.bottom > offscreen.height) {
if (CONTENTVIEW.srcRect.bottom > offscreen.height) {
CONTENTVIEW.srcRect.top = offscreen.height - CONTENTVIEW.srcRect.height; CONTENTVIEW.srcRect.top = offscreen.height - CONTENTVIEW.srcRect.height;
CONTENTVIEW.srcRect.bottom = offscreen.height; CONTENTVIEW.srcRect.bottom = offscreen.height;
} }
...@@ -5124,32 +5122,53 @@ CONTENTVIEW.flip = function(opt) { ...@@ -5124,32 +5122,53 @@ CONTENTVIEW.flip = function(opt) {
context.translate(-(canvas.width/2),-(canvas.height/2)); context.translate(-(canvas.width/2),-(canvas.height/2));
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left; let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top; let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
//if(w > width) w = width; try {
//if(h > height) h = height; context.drawImage(offscreen,
context.drawImage(offscreen, CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h, CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
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{ }else{
context.translate(canvas.width/2,canvas.height/2); context.translate(canvas.width/2,canvas.height/2);
context.rotate($(rotatebtnR).attr('angle')*Math.PI/180); context.rotate($(rotatebtnR).attr('angle')*Math.PI/180);
context.translate(-(canvas.width/2),-(canvas.height/2)); context.translate(-(canvas.width/2),-(canvas.height/2));
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left; let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top; let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
//if(w > width) w = width; try {
// if(h > height) h = height; context.drawImage(offscreen,
context.drawImage(offscreen, CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h, CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, 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{ }else{
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left; let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top; let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
// if(w > width) w = width; try {
// if(h > height) h = height; context.drawImage(offscreen,
context.drawImage(offscreen, CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h, CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height);
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, 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(); context.restore();
} }
else if(opt==2){ else if(opt==2){
...@@ -5314,26 +5333,53 @@ CONTENTVIEW.flip = function(opt) { ...@@ -5314,26 +5333,53 @@ CONTENTVIEW.flip = function(opt) {
context.translate(-(canvas.width/2),-(canvas.height/2)); context.translate(-(canvas.width/2),-(canvas.height/2));
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left; let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top; let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
context.drawImage(offscreen, try {
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h, context.drawImage(offscreen,
CONTENTVIEW.destRect.left, (canvas.height - height)/2, width, height); 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{ }else{
context.translate(canvas.width/2,canvas.height/2); context.translate(canvas.width/2,canvas.height/2);
context.rotate($(rotatebtnR).attr('angle')*Math.PI/180); context.rotate($(rotatebtnR).attr('angle')*Math.PI/180);
context.translate(-(canvas.width/2),-(canvas.height/2)); context.translate(-(canvas.width/2),-(canvas.height/2));
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left; let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top; let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
context.drawImage(offscreen, try {
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h, context.drawImage(offscreen,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, width, height); 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{ }else{
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left; let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top; let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
context.drawImage(offscreen, try {
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h, context.drawImage(offscreen,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, width, height); 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(); 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