Open pritammalunjkar opened 3 years ago
Hi @pritammalunjkar, I am not sure how this is related to my repository. Could explain me why you have posted this here?
mistaken
On Tue, Sep 1, 2020 at 9:53 PM Vrushabh Jambhulkar notifications@github.com wrote:
Hi @pritammalunjkar https://github.com/pritammalunjkar, I am not sure how this is related to my repository. Could explain me why you have posted this here?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vrjgamer/Custom-Alert-Dialog-Box/issues/2#issuecomment-684976999, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALESSN2ZJTCVGDUHGLXCLBTSDUNWJANCNFSM4QRLD7OQ .
--
Thanks & Regards, Pritam Malunjkar
//This is js code---- var mousePressed = false; var lastX, lastY; //var ctx; // Make sure the image is loaded first otherwise nothing will draw.
const IMG_NAMES = { CARDIOVASCULAR_SYSTEM: 'Cardiovascular_System.jpg', FEMALE_REPRODUCTIVE_SYSTEM_1: 'Female_Reproductive_System_1.jpg', FEMALE_REPRODUCTIVE_SYSTEM_2: 'FeMale_Reproductive_System_2.jpg', GASTROINTESTINAL_SYSTEM: 'Gastrointestinal_System.jpg', MALE_REPRODUCTIVE_SYSTEM: 'Male_Reproductive_System.jpg', NEUROLOGICAL_SYSTEM: 'Neurological_System.jpg', RESPIRATORY_SYSTEM: 'Respiratory_System.jpg', UROGENITAL_SYSTEM_EXAMINATION: 'Urogenital_System_examination.jpg',
}
function fnloadBodyTemplate(img_name) {
}
function InitThis(CE_id) { alert("InitThis Function:"+CE_id); // CE_id = "1"; // alert(IMG_NAMES.CARDIOVASCULAR_SYSTEM);
}
function Draw(x, y, isDown) { if (isDown) { ctx.beginPath(); ctx.strokeStyle = $('#selColor').val(); ctx.lineWidth = $('#selWidth').val(); ctx.lineJoin = "round"; ctx.moveTo(lastX, lastY); ctx.lineTo(x, y); ctx.closePath(); ctx.stroke(); } lastX = x; lastY = y; }
function clearArea(CE_id) { // Use the identity matrix while clearing the canvas //alert(CE_id); ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
}
//-------------Button submit
//-------------
function fnAddNote1(vartext) { //http://jsfiddle.net/dval/Kz7VL/ //var texts = []; // alert("Inside Submit Click"); var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d");
// alert(vartext);
}
////////function init(txtNote) ////////{ //////// alert("New Canvas2 Inside Add Note"); //////// // alert("Inside Submit Click"); //////// var canvas1 = document.getElementById("canvas2"); //////// var ctx1 = canvas1.getContext("2d");
//////// // variables used to get mouse position on the canvas //////// var $canvas1 = $("#canvas2"); //////// var canvasOffset = $canvas1.offset(); //////// var offsetX = canvasOffset.left; //////// var offsetY = canvasOffset.top; //////// var scrollX = $canvas1.scrollLeft(); //////// var scrollY = $canvas1.scrollTop();
//////// // variables to save last mouse position //////// // used to see how far the user dragged the mouse //////// // and then move the text by that distance //////// var startX; //////// var startY;
//////// // an array to hold text objects //////// var texts = [];
//////// // this var will hold the index of the hit-selected text //////// var selectedText = -1; //////// // Make sure the image is loaded first otherwise nothing will draw. //////// var vartext = txtNote; //////// alert(vartext);
//////// //// get the text from the input element //////// //var text = //////// // { //////// // text: vartext //////// // //x: 20, //////// // //y: y //////// // };
//////// texts.push({ //////// text: vartext, //////// x: 20, //////// y: 20 //////// });
//////// //ctx1.font = "16px verdana"; //////// //text.width = ctx1.measureText(vartext).width; //////// //text.height = 16; //////// //alert($('#selColor').val()); //////// //ctx1.fillStyle = $('#selColor').val(); //////// //debugger; //////// //ctx1.fillText(text.text, 20, 20); //////// ctx1.font = "16px verdana"; //////// ctx1.fillStyle = $('#selColor').val(); //////// for (var i = 0; i < texts.length; i++) { //////// var text = texts[i]; //////// text.width = ctx1.measureText(text.text).width; //////// text.height = 16; //////// }
//////// // this var will hold the index of the selected text //////// var selectedText = -1;
//////// // START: draw all texts to the canvas //////// //draw(texts); //////// ctx1.clearRect(0, 0, canvas2.width, canvas2.height); //////// for (var i = 0; i < texts.length; i++) { //////// var text = texts[i]; //////// //alert(text.text); //////// // alert(text.x); //////// // alert(text.y); //////// ctx1.fillText(text.text, text.x, text.y); //////// } //////// // listen for mouse events //////// $("#canvas2").mousedown(function (e) { //////// handleMouseDown(e); //////// }); //////// $("#canvas2").mousemove(function (e) { //////// handleMouseMove(e); //////// }); //////// $("#canvas2").mouseup(function (e) { //////// handleMouseUp(e); //////// }); //////// $("#canvas2").mouseout(function (e) { //////// handleMouseOut(e); //////// });
//////// // handle mousedown events //////// // iterate through texts[] and see if the user //////// // mousedown'ed on one of them //////// // If yes, set the selectedText to the index of that text //////// function handleMouseDown(e) { //////// e.preventDefault(); //////// startX = parseInt(e.clientX - offsetX); //////// startY = parseInt(e.clientY - offsetY);
//////// // Put your mousedown stuff here //////// for (var i = 0; i < texts.length; i++) { //////// if (textHittest(startX, startY, i)) { //////// selectedText = i; //////// // alert(selectedText); //////// } //////// } //////// }
//////// // done dragging //////// function handleMouseUp(e) { //////// e.preventDefault(); //////// selectedText = -1; //////// }
//////// // also done dragging //////// function handleMouseOut(e) { //////// e.preventDefault(); //////// selectedText = -1; //////// }
//////// // handle mousemove events //////// // calc how far the mouse has been dragged since //////// // the last mousemove event and move the selected text //////// // by that distance //////// function handleMouseMove(e) //////// { //////// // alert(selectedText); //////// if (selectedText < 0) { //////// return; //////// } //////// e.preventDefault(); //////// mouseX = parseInt(e.clientX - offsetX); //////// mouseY = parseInt(e.clientY - offsetY);
//////// // Put your mousemove stuff here //////// var dx = mouseX - startX; //////// var dy = mouseY - startY; //////// startX = mouseX; //////// startY = mouseY;
//////// var text = texts[selectedText]; //////// text.x += dx; //////// text.y += dy; //////// //draw(); //////// ctx1.clearRect(0, 0, canvas2.width, canvas2.height); //////// for (var i = 0; i < texts.length; i++) { //////// var text = texts[i]; //////// // alert(text.text); //////// // alert(text.x); //////// // alert(text.y); //////// ctx1.fillText(text.text, text.x, text.y); //////// } //////// }
//////// function textHittest(x, y, textIndex) { //////// var text = texts[textIndex]; //////// return (x >= text.x && x <= text.x + text.width && y >= text.y - text.height && y <= text.y); //////// } ////////}
function init() { // canvas related variables
}