Skip to content

Commit

Permalink
fix background img things
Browse files Browse the repository at this point in the history
  • Loading branch information
cracker0dks committed Dec 8, 2022
1 parent fedc7a3 commit ba3cddb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/whiteboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ const whiteboard = {
});

_this.mouseOverlay.on("mousemove touchmove", function (e) {
//Move hole canvas
e.preventDefault();

if (_this.tool == "hand" && _this.drawFlag) {
Expand All @@ -249,6 +250,7 @@ const whiteboard = {
_this.canvas.height = $(window).height(); // Set new canvas height
_this.drawBuffer = [];
_this.textContainer.empty();
_this.imgContainer.empty();
_this.loadData(dbCp); // draw old content in
}

Expand Down Expand Up @@ -987,13 +989,14 @@ const whiteboard = {
dom.i2svg();
},
drawImgToBackground(url, width, height, left, top, rotationAngle) {
var _this = this;
const px = (v) => Number(v).toString() + "px";
this.imgContainer.append(
this.imgWithSrc(url).css({
width: px(width),
height: px(height),
top: px(top),
left: px(left),
top: px(top + _this.viewCoords.y),
left: px(left + _this.viewCoords.x),
position: "absolute",
transform: "rotate(" + Number(rotationAngle) + "rad)",
})
Expand Down

0 comments on commit ba3cddb

Please sign in to comment.