Poonam Sachdeva
8/7/2014 11:49:00 PM
I am moving a rectangle with fill in color in the canvas using mouse drag and mouse drag but the rectangle fill in color disappears in a particular region of the canvas. and then the rectangle is neither selectable nor dragable.
Where can I be going wrong ?
<div id="ImageResultsContainer" style="width:445px; height:445px; overflow:auto;">
<canvas id="ImageResultsCanvas">
Your browser does not support the HTML5 canvas tag.
</canvas>
</div>
function CanvasResultMouseMove(e) {
e.preventDefault();
CanvasUtils.CanvasRect = CanvasUtils.Canvas.getBoundingClientRect();
ShowCoordinates(e);
if (CanvasUtils.SelectedBox2.isROI) {
if (isDrag) {
getMouse(e);
repaint = false;
mySel.x = mx - offsetx;
mySel.y = my - offsety;
var oPixelL = new Pixel();
var oPixelR = new Pixel();
oPixelL.x = mySel.x;
oPixelL.y = mySel.y;
oPixelR.x = mySel.x + mySel.w;
oPixelR.y = mySel.y + mySel.h;
var oDisplayL = ImageCoords(oPixelL);
var oDisplayR = ImageCoords(oPixelR);
document.getElementById("ROI_ULx").value = oDisplayL.x;
document.getElementById("ROI_ULy").value = oDisplayL.y;
document.getElementById("ROI_LRx").value = oDisplayR.x;
document.getElementById("ROI_LRy").value = oDisplayR.y;
invalidate();
}
}
getMouse(e);
if (!isResizeDrag) {
hoverCursorStyle();
}
this.style.cursor = CanvasUtils.CursorStyle;
}