Compare commits

...

5 Commits

Author SHA1 Message Date
Cracker eb29e14bfb
Merge pull request #62 from cracker0dks/dependabot/npm_and_yarn/websocket-extensions-0.1.4
chore(deps): bump websocket-extensions from 0.1.3 to 0.1.4
2020-06-08 12:18:02 +02:00
dependabot[bot] f48596fcf6
chore(deps): bump websocket-extensions from 0.1.3 to 0.1.4
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-08 04:05:02 +00:00
raphael daf759ea4a fix transparent background on saved images 2020-06-03 16:27:45 +02:00
raphael f102739d49 add image faster (without canvas save+reload) if we have no rotation 2020-06-02 18:11:52 +02:00
raphael bbb55eb2b8 fix select area tool 2020-06-02 17:47:28 +02:00
2 changed files with 17 additions and 12 deletions

6
package-lock.json generated
View File

@ -13654,9 +13654,9 @@
}
},
"websocket-extensions": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz",
"integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==",
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",
"integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==",
"dev": true
},
"whatwg-encoding": {

View File

@ -348,13 +348,13 @@ const whiteboard = {
const top = _this.startCoords.y < currentPos.y ? _this.startCoords.y : currentPos.y;
_this.mouseOverlay.css({ cursor: "default" });
const imgDiv = $(
```<div class="dragMe" style="position:absolute; left: ${left}px; top: ${top}px; width: ${width}px; border: 2px dotted gray; overflow: hidden; height: ${height}px;" cursor:move;">
<canvas style="cursor:move; position:absolute; top:0px; left:0px;" width="${width}" height="${height}"/>
`<div class="dragMe" style="position:absolute; left: ${left}px; top: ${top}px; width: ${width}px; border: 2px dotted gray; overflow: hidden; height: ${height}px;" cursor:move;">
<canvas style="cursor:move; position:absolute; top:0px; left:0px;" width="${width}" height="${height}"></canvas>
<div style="position:absolute; right:5px; top:3px;">
<button draw="1" style="margin: 0px 0px; background: #03a9f4; padding: 5px; margin-top: 3px; color: white;" class="addToCanvasBtn btn btn-default">Drop</button>
<button style="margin: 0px 0px; background: #03a9f4; padding: 5px; margin-top: 3px; color: white;" class="xCanvasBtn btn btn-default">x</button>
</div>
</div>```
</div>`
);
const dragCanvas = $(imgDiv).find("canvas");
const dragOutOverlay = $(
@ -987,12 +987,15 @@ const whiteboard = {
var img = document.createElement("img");
img.onload = function () {
rotationAngle = rotationAngle ? rotationAngle : 0;
_this.ctx.save();
_this.ctx.translate(left + width / 2, top + height / 2);
_this.ctx.rotate(rotationAngle);
_this.ctx.drawImage(img, -(width / 2), -(height / 2), width, height);
_this.ctx.restore();
//_this.ctx.drawImage(img, left, top, width, height);
if (rotationAngle === 0) {
_this.ctx.drawImage(img, left, top, width, height);
} else {
_this.ctx.save();
_this.ctx.translate(left + width / 2, top + height / 2);
_this.ctx.rotate(rotationAngle);
_this.ctx.drawImage(img, -(width / 2), -(height / 2), width, height);
_this.ctx.restore();
}
if (doneCallback) {
doneCallback();
}
@ -1263,9 +1266,11 @@ const whiteboard = {
}
if (drawBackgroundGrid) {
destCtx.globalAlpha = 0.8;
var ptrn = destCtx.createPattern(brackGroundImg, "repeat"); // Create a pattern with this image, and set it to "repeat".
destCtx.fillStyle = ptrn;
destCtx.fillRect(0, 0, copyCanvas.width, copyCanvas.height); // context.fillRect(x, y, width, height);
destCtx.globalAlpha = 1;
}
$.each(_this.imgContainer.find("img"), function () {