You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@britannica/pablito

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@britannica/pablito - npm Package Compare versions

Comparing version

to
0.6.2

5

demo/demo.js

@@ -102,2 +102,7 @@ // utility forEach method, because nodeLists don't implement forEach

// Set sticker mode
document.getElementById('set-sticker-mode').addEventListener('click', function() {
stickerbook.enterStickerMode();
});
// Wire up clear

@@ -104,0 +109,0 @@ document.getElementById('clear').addEventListener('click', function() {

2

package.json
{
"name": "@britannica/pablito",
"description": "An HTML 5 drawing framework",
"version": "0.6.1",
"version": "0.6.2",
"main": "./dist/stickerbook.bundle.js",

@@ -6,0 +6,0 @@ "module": "./dist/stickerbook.bundle.js",

@@ -7,3 +7,3 @@ const MaskedPath = require('../masked-path');

*/
const PencilEraserBrush = fabric.util.createClass(fabric.PencilBrush, {
const PencilEraserBrush = window.fabric.util.createClass(window.fabric.PencilBrush, {
/**

@@ -10,0 +10,0 @@ * Overriding the base onMouseDown to fix a weird bug I was seeing: The first path didn't render

@@ -14,4 +14,12 @@ const mouseDownHandler = function (evt) {

}
const clickPoint = this._canvas.getPointer(evt.e);
const stickerImgWidth = this.state.sticker.width;
const stickerImgHeight = this.state.sticker.height;
return this.placeSticker(this._canvas.getPointer(evt.e));
// Adjust coordinates of sticker placement on canvas so that the sticker is centered on the click coordinates
clickPoint.x -= stickerImgWidth / 2;
clickPoint.y -= stickerImgHeight / 2;
return this.placeSticker(clickPoint);
};

@@ -18,0 +26,0 @@

@@ -370,2 +370,12 @@ import validate from './validation/validate';

enterStickerMode() {
this._setState({
img: null,
_stickerAdded: false,
drawing: false,
});
this._canvas.setCursor('move');
}
setPan() {

@@ -372,0 +382,0 @@ throw new Error('not yet implemented: Stickerbook.setPan()');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display