Clear image after switching tools to prevent accidental drawing
This commit is contained in:
parent
3d660885e0
commit
f5c56af2d2
@ -99,7 +99,7 @@ $("#page-canvas-container").on("click", ".page-canvas", function (evt) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#page-canvas-container").on("click", ".page-canvas.active", function (evt) {
|
$("#page-canvas-container").on("click", ".page-canvas.active", function (evt) {
|
||||||
if (typeof activeDrawImage == "undefined") {
|
if (typeof activeDrawImage == "undefined" || activeDrawImage == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var canvas = $(this)[0];
|
var canvas = $(this)[0];
|
||||||
@ -137,6 +137,7 @@ function disableGuideBox() {
|
|||||||
|
|
||||||
var context = $("#placementguidebox")[0].getContext('2d');
|
var context = $("#placementguidebox")[0].getContext('2d');
|
||||||
context.clearRect(0, 0, $("#placementguidebox")[0].width, $("#placementguidebox")[0].height);
|
context.clearRect(0, 0, $("#placementguidebox")[0].width, $("#placementguidebox")[0].height);
|
||||||
|
activeDrawImage = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#page-canvas-container").on("mousemove", function (evt) {
|
$("#page-canvas-container").on("mousemove", function (evt) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user