Commit 98e614bd by Masaru Abe

#11478 解像度改善対応

parent 7bb2118e
...@@ -3143,25 +3143,40 @@ ContentPage.prototype.drawPage = function (context, opt) { ...@@ -3143,25 +3143,40 @@ ContentPage.prototype.drawPage = function (context, opt) {
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
if(opt == null || opt == 0){ if(opt == null || opt == 0){
getPageSizeByPageNo(changePageIndex(getPageIndex())); getPageSizeByPageNo(changePageIndex(getPageIndex()));
widthEachPage = widthContentImage; //#11478
heightEachPage = heightContentImage; //widthEachPage = widthContentImage;
//heightEachPage = heightContentImage;
widthEachPageApi = widthContentImage;
heightEachPageApi = heightContentImage;
} }
else if(opt == 1){ else if(opt == 1){
getPageSizeByPageNo(changePageIndex(getPageIndex() + 1)); getPageSizeByPageNo(changePageIndex(getPageIndex() + 1));
widthEachNextPage = widthContentImage; widthEachNextPage = widthContentImage;
heightEachNextPage = heightContentImage; heightEachNextPage = heightContentImage;
//#11478
widthEachNextPageApi = widthContentImage;
heightEachNextPageApi = heightContentImage;
} }
else if(opt == 2){ else if(opt == 2){
getPageSizeByPageNo(changePageIndex(getPageIndex() - 1)); getPageSizeByPageNo(changePageIndex(getPageIndex() - 1));
widthEachPrevPage = widthContentImage; widthEachPrevPage = widthContentImage;
heightEachPrevPage = heightContentImage; heightEachPrevPage = heightContentImage;
//#11478
widthEachPrevPageApi = widthContentImage;
heightEachPrevPageApi = heightContentImage;
} }
} }
else{ else{
widthEachPage = widthContentImage; widthEachPage = widthContentImage;
heightEachPage = heightContentImage; heightEachPage = heightContentImage;
} //#11478
widthEachPageApi = widthContentImage;
heightEachPageApi = heightContentImage;
widthEachNextPageApi = widthContentImage;
heightEachNextPageApi = heightContentImage;
widthEachPrevPageApi = widthContentImage;
heightEachPrevPageApi = heightContentImage;
}
/* set width canvas */ /* set width canvas */
/* /*
...@@ -3184,18 +3199,19 @@ ContentPage.prototype.drawPage = function (context, opt) { ...@@ -3184,18 +3199,19 @@ ContentPage.prototype.drawPage = function (context, opt) {
}*/ }*/
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
if(opt == null || opt == 0){ //#11478
$("#offscreen").attr('height', heightEachPage); //if(opt == null || opt == 0){
$("#offscreen").attr('width', widthEachPage); // $("#offscreen").attr('height', heightEachPage);
} // $("#offscreen").attr('width', widthEachPage);
else if(opt == 1){ //}
$("#offscreenNext").attr('height', heightEachNextPage); //else if(opt == 1){
$("#offscreenNext").attr('width', widthEachNextPage); // $("#offscreenNext").attr('height', heightEachNextPage);
} // $("#offscreenNext").attr('width', widthEachNextPage);
else if(opt == 2){ //}
$("#offscreenPre").attr('height', heightEachPrevPage); //else if(opt == 2){
$("#offscreenPre").attr('width', widthEachPrevPage); // $("#offscreenPre").attr('height', heightEachPrevPage);
} // $("#offscreenPre").attr('width', widthEachPrevPage);
//}
} }
else{ else{
if(opt == null || opt == 0){ if(opt == null || opt == 0){
...@@ -3220,12 +3236,30 @@ ContentPage.prototype.drawPage = function (context, opt) { ...@@ -3220,12 +3236,30 @@ ContentPage.prototype.drawPage = function (context, opt) {
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
if(contentType == ContentTypeKeys.Type_PDF){ if(contentType == ContentTypeKeys.Type_PDF){
if(opt == null || opt == 0){ if(opt == null || opt == 0){
//#11478
heightEachPage = img.naturalHeight;
widthEachPage = img.naturalWidth;
$("#offscreen").attr('height', heightEachPage);
$("#offscreen").attr('width', widthEachPage);
context.drawImage(img, 0, 0, widthEachPage, heightEachPage); context.drawImage(img, 0, 0, widthEachPage, heightEachPage);
} }
else if(opt == 1){ else if(opt == 1){
//#11478
heightEachNextPage = img.naturalHeight;
widthEachNextPage = img.naturalWidth;
$("#offscreenNext").attr('height', heightEachNextPage);
$("#offscreenNext").attr('width', widthEachNextPage);
context.drawImage(img, 0, 0, widthEachNextPage, heightEachNextPage); context.drawImage(img, 0, 0, widthEachNextPage, heightEachNextPage);
} }
else if(opt == 2){ else if(opt == 2){
//#11478
heightEachPrevPage = img.naturalHeight;
widthEachPrevPage = img.naturalWidth;
$("#offscreenPre").attr('height', heightEachPrevPage);
$("#offscreenPre").attr('width', widthEachPrevPage);
context.drawImage(img, 0, 0, widthEachPrevPage, heightEachPrevPage); context.drawImage(img, 0, 0, widthEachPrevPage, heightEachPrevPage);
} }
} }
...@@ -4010,7 +4044,7 @@ function drawCanvas(opt) { ...@@ -4010,7 +4044,7 @@ function drawCanvas(opt) {
context.clearRect(0, 0, canvas.width, canvas.height); context.clearRect(0, 0, canvas.width, canvas.height);
draw(context); draw(context, 0);
} }
//Draw on next offscreen //Draw on next offscreen
else if (opt==1){ else if (opt==1){
...@@ -4828,7 +4862,26 @@ function changeImageType4(objTarget, nIndex, nIndex1) { ...@@ -4828,7 +4862,26 @@ function changeImageType4(objTarget, nIndex, nIndex1) {
imageObj.onload = function () { imageObj.onload = function () {
var canvasObject = document.getElementById("offscreen"); var canvasObject = document.getElementById("offscreen");
var contextObject = canvasObject.getContext("2d"); var contextObject = canvasObject.getContext("2d");
contextObject.drawImage(imageObj, objTarget[nIndex].x, objTarget[nIndex].y, objTarget[nIndex].width, objTarget[nIndex].height);
//#11478
var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var tmpX = objTarget[nIndex].x * tempRatioWidth;
var tmpY = objTarget[nIndex].y * tempRatioHeight;
var tmpW = objTarget[nIndex].width * tempRatioWidth;
var tmpH = objTarget[nIndex].height * tempRatioHeight;
contextObject.drawImage(imageObj, tmpX, tmpY, tmpW, tmpH);
//contextObject.drawImage(imageObj, objTarget[nIndex].x, objTarget[nIndex].y, objTarget[nIndex].width, objTarget[nIndex].height);
flip(); flip();
}; };
imageObj.src = objTarget[nIndex].dataObjects[nIndex1].fileName; imageObj.src = objTarget[nIndex].dataObjects[nIndex1].fileName;
...@@ -4836,14 +4889,28 @@ function changeImageType4(objTarget, nIndex, nIndex1) { ...@@ -4836,14 +4889,28 @@ function changeImageType4(objTarget, nIndex, nIndex1) {
function imageToScreen(x, y) { function imageToScreen(x, y) {
//#11478
var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var tmpX = x * tempRatioWidth;
var tmpY = y * tempRatioHeight;
var pt = new Point(0, 0); var pt = new Point(0, 0);
// scale vertical and horizontal // scale vertical and horizontal
var sx = (destRect.right - destRect.left) / (srcRect.right - srcRect.left); var sx = (destRect.right - destRect.left) / (srcRect.right - srcRect.left);
var sy = (destRect.bottom - destRect.top) / (srcRect.bottom - srcRect.top); var sy = (destRect.bottom - destRect.top) / (srcRect.bottom - srcRect.top);
pt.x = Math.round(sx * (x - srcRect.left)) + destRect.left + marginX; pt.x = Math.round(sx * (tmpX - srcRect.left)) + destRect.left + marginX;
pt.y = Math.round(sy * (y - srcRect.top)) + destRect.top + marginY; pt.y = Math.round(sy * (tmpY - srcRect.top)) + destRect.top + marginY;
return pt; return pt;
}; };
......
...@@ -28,20 +28,59 @@ MemoObject.prototype.setup = function (id, text, x, y, w, h, imageUrl) { ...@@ -28,20 +28,59 @@ MemoObject.prototype.setup = function (id, text, x, y, w, h, imageUrl) {
/* prototype hitTest */ /* prototype hitTest */
MemoObject.prototype.hitTest = function (px, py) { MemoObject.prototype.hitTest = function (px, py) {
if (this.x <= px && px <= (this.x + this.width)) {
if (this.y <= py && py <= (this.y + this.height)) { //#11478
var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var tmpX = this.x * tempRatioWidth;
var tmpY = this.y * tempRatioHeight;
var tmpW = this.width * tempRatioWidth;
var tmpH = this.height * tempRatioHeight;
if (tmpX <= px && px <= (tmpX + tmpW)) {
if (tmpY <= py && py <= (tmpY + tmpH)) {
return true; return true;
} }
} }
//if (this.x <= px && px <= (this.x + this.width)) {
// if (this.y <= py && py <= (this.y + this.height)) {
// return true;
// }
//}
return false; return false;
}; };
/* draw Memo */ /* draw Memo */
MemoObject.prototype.drawMemo = function (context, opt) { MemoObject.prototype.drawMemo = function (context, opt) {
var posX = this.x;
var posY = this.y; //#1478
var objWidth = this.width; var canvasWidth = $('#offscreen').width();
var objHeigth = this.height; var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var posX = this.x * tempRatioWidth;
var posY = this.y * tempRatioHeight;
var objWidth = this.width * tempRatioWidth;
var objHeigth = this.height * tempRatioHeight;
//var posX = this.x;
//var posY = this.y;
//var objWidth = this.width;
//var objHeigth = this.height;
var imageObj = new Image(); var imageObj = new Image();
imageObj.onload = function () { imageObj.onload = function () {
...@@ -103,8 +142,25 @@ WebGetContentTyp4Object.prototype.setup = function (id, x, y, w, h, imageUrl) { ...@@ -103,8 +142,25 @@ WebGetContentTyp4Object.prototype.setup = function (id, x, y, w, h, imageUrl) {
/* prototype hitTest */ /* prototype hitTest */
WebGetContentTyp4Object.prototype.hitTest = function (px, py) { WebGetContentTyp4Object.prototype.hitTest = function (px, py) {
if (this.x <= px && px <= (this.x + this.width)) {
if (this.y <= py && py <= (this.y + this.height)) { //#11478
var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var tmpX = this.x * tempRatioWidth;
var tmpY = this.y * tempRatioHeight;
var tmpW = this.width * tempRatioWidth;
var tmpH = this.height * tempRatioHeight;
if (tmpX <= px && px <= (tmpX + tmpW)) {
if (tmpY <= py && py <= (tmpY + tmpH)) {
return true; return true;
} }
} }
...@@ -113,10 +169,23 @@ WebGetContentTyp4Object.prototype.hitTest = function (px, py) { ...@@ -113,10 +169,23 @@ WebGetContentTyp4Object.prototype.hitTest = function (px, py) {
/* draw Memo */ /* draw Memo */
WebGetContentTyp4Object.prototype.drawObject = function (context, opt) { WebGetContentTyp4Object.prototype.drawObject = function (context, opt) {
var posX = this.x;
var posY = this.y; //#11478
var objWidth = this.width; var canvasWidth = $('#offscreen').width();
var objHeigth = this.height; var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var posX = this.x * tempRatioWidth;
var posY = this.y * tempRatioHeight;
var objWidth = this.width * tempRatioWidth;
var objHeigth = this.height * tempRatioHeight;
var imageObj = new Image(); var imageObj = new Image();
imageObj.onload = function () { imageObj.onload = function () {
context.globalAlpha = 0.4; context.globalAlpha = 0.4;
...@@ -186,11 +255,33 @@ PageObject.prototype.setup = function (mediaType, actionType, id, imageUrl, x, y ...@@ -186,11 +255,33 @@ PageObject.prototype.setup = function (mediaType, actionType, id, imageUrl, x, y
/* prototype hitTest */ /* prototype hitTest */
PageObject.prototype.hitTest = function (px, py) { PageObject.prototype.hitTest = function (px, py) {
if (this.x <= px && px <= (this.x + this.width)) {
if (this.y <= py && py <= (this.y + this.height)) { //#11478
var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var tmpX = this.x * tempRatioWidth;
var tmpY = this.y * tempRatioHeight;
var tmpW = this.width * tempRatioWidth;
var tmpH = this.height * tempRatioHeight;
if ( tmpX <= px && px <= (tmpX + tmpW)) {
if (tmpY <= py && py <= (tmpY + tmpH)) {
return true; return true;
} }
} }
//if (this.x <= px && px <= (this.x + this.width)) {
// if (this.y <= py && py <= (this.y + this.height)) {
// return true;
// }
//}
return false; return false;
}; };
var check; var check;
...@@ -199,26 +290,73 @@ var check; ...@@ -199,26 +290,73 @@ var check;
PageObject.prototype.drawPageObject = function (context, opt) { PageObject.prototype.drawPageObject = function (context, opt) {
var nObjectCnt = 0; var nObjectCnt = 0;
//#11478
var tempRatioWidth = 1;
var tempRatioHeight = 1;
var canvasWidth = 0;
var canvasHeight = 0;
//Check which pageObject to be count //Check which pageObject to be count
if(opt == null || opt == 0){ if(opt == null || opt == 0){
nObjectCnt = pageObjects.length; nObjectCnt = pageObjects.length;
//#11478
canvasWidth = $('#offscreen').width();
canvasHeight = $('#offscreen').height();
tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
} }
else if(opt == 1){ else if(opt == 1){
nObjectCnt = nextPageObjects.length; nObjectCnt = nextPageObjects.length;
//#11478
canvasWidth = $('#offscreenNext').width();
canvasHeight = $('#offscreenNext').height();
tempRatioWidth = canvasWidth / widthEachNextPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachNextPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
} }
else if(opt == 2){ else if(opt == 2){
nObjectCnt = prevPageObjects.length; nObjectCnt = prevPageObjects.length;
//#11478
canvasWidth = $('#offscreenPre').width();
canvasHeight = $('#offscreenPre').height();
tempRatioWidth = canvasWidth / widthEachPrevPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPrevPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
} }
if (this.visible) { if (this.visible) {
/* init data */ /* init data */
var mediaType = this.mediaType; var mediaType = this.mediaType;
var displayBorder = this.displayBorder; var displayBorder = this.displayBorder;
var x = this.x;
var y = this.y; //#11478
var w = this.width; var x = this.x * tempRatioWidth;
var h = this.height; var y = this.y * tempRatioHeight;
var w = this.width * tempRatioWidth;
var h = this.height * tempRatioHeight;
var tempUrl = this.imageUrl; var tempUrl = this.imageUrl;
var isUsedTempImg = false; var isUsedTempImg = false;
...@@ -461,12 +599,28 @@ var object3d = function (mediaType, actionType, id, imageUrl, x, y, w, h, hCnt, ...@@ -461,12 +599,28 @@ var object3d = function (mediaType, actionType, id, imageUrl, x, y, w, h, hCnt,
//abe //abe
//alert("object3d"); //alert("object3d");
//#11478
var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var tmpX = x * tempRatioWidth;
var tmpY = y * tempRatioHeight;
var tmpW = w * tempRatioWidth;
var tmpH = h * tempRatioHeight;
if(_3dAction == _3dActionType.TouchStart_MouseDown){ if(_3dAction == _3dActionType.TouchStart_MouseDown){
OnMouseDown3D(id, imagePt, x, y); OnMouseDown3D(id, imagePt, tmpX, tmpY);
} }
else if(_3dAction == _3dActionType.TouchMove_MouseMove){ else if(_3dAction == _3dActionType.TouchMove_MouseMove){
OnMouseMove3D(id, imagePt, x, y, w, h, hCnt, vCnt); OnMouseMove3D(id, imagePt, tmpX, tmpY, tmpW, tmpH, hCnt, vCnt);
} }
else if(_3dAction == _3dActionType.TouchEnd_MouseUp){ else if(_3dAction == _3dActionType.TouchEnd_MouseUp){
OnMouseEnd3D(id, hCnt, vCnt); OnMouseEnd3D(id, hCnt, vCnt);
...@@ -548,7 +702,24 @@ var listImage = function (mediaType, id, imageUrl, x, y, w, h, visible, imageObj ...@@ -548,7 +702,24 @@ var listImage = function (mediaType, id, imageUrl, x, y, w, h, visible, imageObj
imageObj.onload = function () { imageObj.onload = function () {
var canvasObject = document.getElementById("offscreen"); var canvasObject = document.getElementById("offscreen");
var contextObject = canvasObject.getContext("2d"); var contextObject = canvasObject.getContext("2d");
contextObject.drawImage(imageObj, x, y, w, h);
//#11478
var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height();
var tempRatioWidth = canvasWidth / widthEachPageApi;
if( tempRatioWidth < 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = canvasHeight / heightEachPageApi;
if( tempRatioHeight < 1 ){
tempRatioHeight = 1;
}
var tmpX = x * tempRatioWidth;
var tmpY = y * tempRatioHeight;
var tmpW = w * tempRatioWidth;
var tmpH = h * tempRatioHeight;
contextObject.drawImage(imageObj, tmpX, tmpY, tmpW, tmpH);
flip(); flip();
}; };
imageObj.src = imageObjects[mediaType4_changeImage].fileName; imageObj.src = imageObjects[mediaType4_changeImage].fileName;
......
...@@ -101,6 +101,15 @@ var widthEachPrevPage = 0; ...@@ -101,6 +101,15 @@ var widthEachPrevPage = 0;
var heightEachPrevPage = 0; var heightEachPrevPage = 0;
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
//#11478
var widthEachPageApi = 0;
var heightEachPageApi = 0;
var widthEachNextPageApi = 0;
var heightEachNextPageApi = 0;
var widthEachPrevPageApi = 0;
var heightEachPrevPageApi = 0;
//#11478
/* zoom video */ /* zoom video */
var pxVideo; var pxVideo;
var pyVideo; var pyVideo;
......
...@@ -1388,6 +1388,9 @@ function getPrevPageObjectsByPageIndex(contentData, nIndexPage) { ...@@ -1388,6 +1388,9 @@ function getPrevPageObjectsByPageIndex(contentData, nIndexPage) {
function switchCanvas(nav){ function switchCanvas(nav){
// change div id // change div id
//console.log("bf widthEachPage:" + widthEachPage + " widthEachNextPage:" + widthEachNextPage + " widthEachPrevPage:" + widthEachPrevPage);
//console.log("bf widthEachPageApi:" + widthEachPageApi + " widthEachNextPageApi:" + widthEachNextPageApi + " widthEachPrevPageApi:" + widthEachPrevPageApi);
if(nav == 1){ if(nav == 1){
$('#mainPre').attr("id","mainPreBK"); $('#mainPre').attr("id","mainPreBK");
$('#main').attr("id","mainPre"); $('#main').attr("id","mainPre");
...@@ -1402,9 +1405,15 @@ function switchCanvas(nav){ ...@@ -1402,9 +1405,15 @@ function switchCanvas(nav){
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
widthEachPrevPage = widthEachPage; widthEachPrevPage = widthEachPage;
widthEachPage = widthEachNextPage; widthEachPage = widthEachNextPage;
//#11478
widthEachPrevPageApi = widthEachPageApi;
widthEachPageApi = widthEachNextPageApi;
heightEachPrevPage = heightEachPage; heightEachPrevPage = heightEachPage;
heightEachPage = heightEachNextPage; heightEachPage = heightEachNextPage;
//#11478
heightEachPrevPageApi = heightEachPageApi;
heightEachPageApi = heightEachNextPageApi;
srcRectPrev = srcRect; srcRectPrev = srcRect;
srcRect = srcRectNext; srcRect = srcRectNext;
...@@ -1432,9 +1441,15 @@ function switchCanvas(nav){ ...@@ -1432,9 +1441,15 @@ function switchCanvas(nav){
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
widthEachNextPage = widthEachPage; widthEachNextPage = widthEachPage;
widthEachPage = widthEachPrevPage; widthEachPage = widthEachPrevPage;
//#11478
widthEachNextPageApi = widthEachPageApi;
widthEachPageApi = widthEachPrevPageApi;
heightEachNextPage = heightEachPage; heightEachNextPage = heightEachPage;
heightEachPage = heightEachPrevPage; heightEachPage = heightEachPrevPage;
//#11478
heightEachNextPageApi = heightEachPageApi;
heightEachPageApi = heightEachPrevPageApi;
srcRectNext = srcRect; srcRectNext = srcRect;
srcRect = srcRectPrev; srcRect = srcRectPrev;
...@@ -1448,7 +1463,10 @@ function switchCanvas(nav){ ...@@ -1448,7 +1463,10 @@ function switchCanvas(nav){
flip(); flip();
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content //END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
} }
//console.log("af widthEachPage:" + widthEachPage + " widthEachNextPage:" + widthEachNextPage + " widthEachPrevPage:" + widthEachPrevPage);
//console.log("af widthEachPageApi:" + widthEachPageApi + " widthEachNextPageApi:" + widthEachNextPageApi + " widthEachPrevPageApi:" + widthEachPrevPageApi);
}; };
//Assign content properties //Assign content properties
......
...@@ -53,8 +53,12 @@ function dlgMarking_dspSave_click() { ...@@ -53,8 +53,12 @@ function dlgMarking_dspSave_click() {
marking.pageNo = changePageIndex(getPageIndex()); marking.pageNo = changePageIndex(getPageIndex());
} }
var saveCanvas = document.createElement('canvas'); var saveCanvas = document.createElement('canvas');
saveCanvas.width = canvas_offscreen.width; //#11478
saveCanvas.height = canvas_offscreen.height; //saveCanvas.width = canvas_offscreen.width;
//saveCanvas.height = canvas_offscreen.height;
saveCanvas.width = widthEachPageApi;
saveCanvas.height = heightEachPageApi;
var saveContext = saveCanvas.getContext('2d'); var saveContext = saveCanvas.getContext('2d');
saveContext.drawImage(saveImg, 0, 0, saveCanvas.width, saveCanvas.height); saveContext.drawImage(saveImg, 0, 0, saveCanvas.width, saveCanvas.height);
...@@ -87,7 +91,9 @@ function dlgMarking_dspSave_click() { ...@@ -87,7 +91,9 @@ function dlgMarking_dspSave_click() {
/* case exist marking */ /* case exist marking */
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker. //=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker.
var editedMarkingEntity = arr[nIndexMarking]; var editedMarkingEntity = arr[nIndexMarking];
editedMarkingEntity.content = canvas_draw.toDataURL("image/png"); //#11478
//editedMarkingEntity.content = canvas_draw.toDataURL("image/png");
editedMarkingEntity.content = marking.content;
editedMarkingEntity.registerDate = new Date(); editedMarkingEntity.registerDate = new Date();
arr[nIndexMarking] = editedMarkingEntity; arr[nIndexMarking] = editedMarkingEntity;
......
...@@ -47,8 +47,24 @@ function memoSaveFunction(){ ...@@ -47,8 +47,24 @@ function memoSaveFunction(){
memoObj.contentid = conid; memoObj.contentid = conid;
memoObj.Text = $('#txaMemoContent').val(); memoObj.Text = $('#txaMemoContent').val();
var imagePt = screenToImage(targetX, targetY); var imagePt = screenToImage(targetX, targetY);
memoObj.posX = imagePt.x;
memoObj.posY = imagePt.y; //#11478 逆に縮める対応
var canvasWidth = $('#offscreen').width();
var canvasHeight = $('#offscreen').height();
//var tempRatioWidth = canvasWidth / widthEachPageApi;
var tempRatioWidth = widthEachPageApi / canvasWidth;
if( tempRatioWidth > 1 ){
tempRatioWidth = 1;
}
var tempRatioHeight = heightEachPageApi / canvasHeight;
if( tempRatioHeight > 1 ){
tempRatioHeight = 1;
}
memoObj.posX = Math.round(imagePt.x * tempRatioWidth);
memoObj.posY = Math.round(imagePt.y * tempRatioHeight);
//memoObj.posX = imagePt.x;
//memoObj.posY = imagePt.y;
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new memo. //=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new memo.
memoObj.memoid = getUUID(); memoObj.memoid = getUUID();
memoObj.registerDate = new Date(); memoObj.registerDate = new Date();
......
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