Commit 0899f58a by Takuya Ogawa

Merge branch 'contract/ttss/1.0.0_kim-ec' into contract/ttss/1.1.0

parents db31bce5 eaccfcfd
...@@ -5120,21 +5120,54 @@ CONTENTVIEW.flip = function(opt) { ...@@ -5120,21 +5120,54 @@ CONTENTVIEW.flip = function(opt) {
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 h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
try {
context.drawImage(offscreen, context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top, 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); 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 h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
try {
context.drawImage(offscreen, context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, 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{
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
try {
context.drawImage(offscreen, context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, 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);
}
} }
context.restore(); context.restore();
} }
...@@ -5298,21 +5331,54 @@ CONTENTVIEW.flip = function(opt) { ...@@ -5298,21 +5331,54 @@ CONTENTVIEW.flip = function(opt) {
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 h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
try {
context.drawImage(offscreen, context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top, 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); 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 h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
try {
context.drawImage(offscreen, context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, 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{
let w = CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left;
let h = CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top;
try {
context.drawImage(offscreen, context.drawImage(offscreen,
CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.right - CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.bottom - CONTENTVIEW.srcRect.top, CONTENTVIEW.srcRect.left, CONTENTVIEW.srcRect.top, w, h,
CONTENTVIEW.destRect.left, CONTENTVIEW.destRect.top, 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);
}
} }
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