New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

leaflet-distortableimage

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-distortableimage - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

.git/logs/refs/heads/readme

2

package.json
{
"name": "leaflet-distortableimage",
"version": "0.6.1",
"version": "0.6.2",
"description": "Leaflet plugin enabling image overlays to be distorted, stretched, and warped (built for Public Lab's MapKnitter: http://publiclab.org).",

@@ -5,0 +5,0 @@ "scripts": {

@@ -5,2 +5,3 @@ Leaflet.DistortableImage

[![Build Status](https://travis-ci.org/publiclab/Leaflet.DistortableImage.svg?branch=master)](https://travis-ci.org/publiclab/Leaflet.DistortableImage)
[![npm version](https://badge.fury.io/js/leaflet-distortableimage.svg)](https://badge.fury.io/js/leaflet-distortableimage)

@@ -103,3 +104,3 @@ A Leaflet extension to distort images -- "rubbersheeting" -- for the [MapKnitter.org](http://mapknitter.org) ([src](https://github.com/publiclab/mapknitter)) image georectification service by [Public Lab](http://publiclab.org). Leaflet.DistortableImage allows for perspectival distortions of images, client-side, using CSS3 transformations in the DOM.

img = L.distortableImageOverlay(
'example.png', {
* 'example.png', {
// 'corners' is the only required option for this class

@@ -153,3 +154,3 @@ // and is in NW, NE, SW, SE order

Note: when working with the multi image interface, the collection group will ensure only the last overlay you pass `selected` to will appear initially selected.
Note: when working with the multi image interface, only the last overlay you pass `selected: true` to will appear with editing handles _and_ a toolbar.

@@ -156,0 +157,0 @@ ### Mode

@@ -22,4 +22,2 @@ L.DistortableCollection = L.FeatureGroup.extend({

}, this);
this._lastInitialSelected();
},

@@ -125,18 +123,2 @@

_lastInitialSelected: function() {
var layerArr = this.getLayers();
var initialSelected = layerArr.filter(function(layer) {
return layer.options.selected;
});
if (initialSelected.length !== 0) {
this.eachLayer(function(layer) {
if (!initialSelected[-1]) {
layer._deselect();
}
});
}
},
_longPressMultiSelect: function(e) {

@@ -143,0 +125,0 @@ var image = e.target;

@@ -8,3 +8,3 @@ L.DistortableImageOverlay = L.ImageOverlay.extend({

// todo: find ideal number to prevent distortions during RotateScale, and make it dynamic (remove hardcoding)
edgeMinWidth: 520
edgeMinWidth: 50
},

@@ -11,0 +11,0 @@

@@ -509,3 +509,2 @@ L.DistortableImage = L.DistortableImage || {};

// TODO: toolbar for multiple image selection
_showToolbar: function() {

@@ -512,0 +511,0 @@ var overlay = this._overlay,

@@ -27,6 +27,9 @@ L.RotateScaleHandle = L.EditHandle.extend({

if (overlay.hasOwnProperty('edgeMinWidth')){
var edgeMinWidth = overlay.edgeMinWidth,
w = L.latLng(overlay.getCorner(0)).distanceTo(overlay.getCorner(1)),
h = L.latLng(overlay.getCorner(1)).distanceTo(overlay.getCorner(2));
if ((w > edgeMinWidth && h > edgeMinWidth) || scale > 1) {
var edgeMinWidth = overlay.edgeMinWidth;
var corner1 = overlay._map.latLngToContainerPoint(overlay.getCorner(0)),
corner2 = overlay._map.latLngToContainerPoint(overlay.getCorner(1));
var w = Math.abs(corner1.x - corner2.x);
var h = Math.abs(corner1.y - corner2.y);
var distance = Math.sqrt(w * w + h * h);
if ((distance > edgeMinWidth) || scale > 1) {
edit._scaleBy(scale);

@@ -33,0 +36,0 @@ }

Sorry, the diff of this file is not supported yet

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc