fix background img things

This commit is contained in:
Raphael 2022-12-08 15:00:15 +01:00
parent fedc7a3c01
commit ba3cddb8e4

View File

@ -231,6 +231,7 @@ const whiteboard = {
}); });
_this.mouseOverlay.on("mousemove touchmove", function (e) { _this.mouseOverlay.on("mousemove touchmove", function (e) {
//Move hole canvas
e.preventDefault(); e.preventDefault();
if (_this.tool == "hand" && _this.drawFlag) { if (_this.tool == "hand" && _this.drawFlag) {
@ -249,6 +250,7 @@ const whiteboard = {
_this.canvas.height = $(window).height(); // Set new canvas height _this.canvas.height = $(window).height(); // Set new canvas height
_this.drawBuffer = []; _this.drawBuffer = [];
_this.textContainer.empty(); _this.textContainer.empty();
_this.imgContainer.empty();
_this.loadData(dbCp); // draw old content in _this.loadData(dbCp); // draw old content in
} }
@ -987,13 +989,14 @@ const whiteboard = {
dom.i2svg(); dom.i2svg();
}, },
drawImgToBackground(url, width, height, left, top, rotationAngle) { drawImgToBackground(url, width, height, left, top, rotationAngle) {
var _this = this;
const px = (v) => Number(v).toString() + "px"; const px = (v) => Number(v).toString() + "px";
this.imgContainer.append( this.imgContainer.append(
this.imgWithSrc(url).css({ this.imgWithSrc(url).css({
width: px(width), width: px(width),
height: px(height), height: px(height),
top: px(top), top: px(top + _this.viewCoords.y),
left: px(left), left: px(left + _this.viewCoords.x),
position: "absolute", position: "absolute",
transform: "rotate(" + Number(rotationAngle) + "rad)", transform: "rotate(" + Number(rotationAngle) + "rad)",
}) })