Skip to content

Commit

Permalink
fix reported bugs
Browse files Browse the repository at this point in the history
fixes #306
  • Loading branch information
rexagod committed Jul 21, 2019
1 parent a83f986 commit 4386c28
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 27 deletions.
Binary file added assets/icons/markers/question-mark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/icons/svg-min/unlock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/icons/svg/unlock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/icons/symbol/sprite.symbol.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<symbol viewBox="0 0 14 18" id="opacity-empty" xmlns="http://www.w3.org/2000/svg"><path fill="#0078A8" stroke="#0078A8" stroke-width="1.7" d="M10.708 6.25A5.113 5.113 0 0 1 12.2 9.846c0 1.275-.497 2.62-1.492 3.614a5.094 5.094 0 0 1-7.216 0A5.156 5.156 0 0 1 2 9.846c0-1.275.497-2.601 1.492-3.596L7.1 2.648l3.608 3.602zm0 0L7.1 2.648 3.492 6.25A5.113 5.113 0 0 0 2 9.846c0 1.275.497 2.62 1.492 3.614a5.094 5.094 0 0 0 7.216 0A5.156 5.156 0 0 0 12.2 9.846a5.113 5.113 0 0 0-1.492-3.596z"/></symbol>
<symbol viewBox="0 0 18 18" id="restore" xmlns="http://www.w3.org/2000/svg"><path fill="#058dc4" d="M15.67 3.839a.295.295 0 0 0-.22.103l-5.116 3.249V4.179a.342.342 0 0 0-.193-.315.29.29 0 0 0-.338.078L3.806 7.751v-4.63h-.002l.002-.022c0-.277-.204-.502-.456-.502h-.873V2.6c-.253 0-.457.225-.457.503l.002.026v10.883h.005c.021.257.217.454.452.455l.016-.002h.822c.013.001.025.004.038.004.252 0 .457-.225.457-.502a.505.505 0 0 0-.006-.068V9.318l6.001 3.811a.288.288 0 0 0 .332.074.34.34 0 0 0 .194-.306V9.878l5.12 3.252a.288.288 0 0 0 .332.073.34.34 0 0 0 .194-.306V4.18a.358.358 0 0 0-.09-.24.296.296 0 0 0-.218-.1z"/></symbol>
<symbol viewBox="0 0 18 18" id="transform" xmlns="http://www.w3.org/2000/svg"><path fill="#0078A8" d="M16.5 13.5V12H6V3h1.5L5.25.75 3 3h1.5v1.5h-3V6h3v6c0 .825.675 1.5 1.5 1.5h6V15h-1.5l2.25 2.25L15 15h-1.5v-1.5h3zM7.5 6H12v4.5h1.5V6c0-.825-.675-1.5-1.5-1.5H7.5V6z"/></symbol>
<symbol viewBox="0 0 18 18" id="unlock" xmlns="http://www.w3.org/2000/svg"><path fill="#0078A8" d="M13.5 6h-.75V4.5C12.75 2.43 11.07.75 9 .75 6.93.75 5.25 2.43 5.25 4.5h1.5A2.247 2.247 0 0 1 9 2.25a2.247 2.247 0 0 1 2.25 2.25V6H4.5C3.675 6 3 6.675 3 7.5V15c0 .825.675 1.5 1.5 1.5h9c.825 0 1.5-.675 1.5-1.5V7.5c0-.825-.675-1.5-1.5-1.5zm0 9h-9V7.5h9V15zM9 12.75c.825 0 1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5-1.5.675-1.5 1.5.675 1.5 1.5 1.5z"/></symbol>
<symbol viewBox="0 0 18 18" id="unlock" xmlns="http://www.w3.org/2000/svg"><path d="M13.5 6h-.75V4.5C12.75 2.43 11.07.75 9 .75 6.93.75 5.25 2.43 5.25 4.5V6H4.5C3.675 6 3 6.675 3 7.5V15c0 .825.675 1.5 1.5 1.5h9c.825 0 1.5-.675 1.5-1.5V7.5c0-.825-.675-1.5-1.5-1.5zM6.75 4.5A2.247 2.247 0 0 1 9 2.25a2.247 2.247 0 0 1 2.25 2.25V6h-4.5V4.5zM13.5 15h-9V7.5h9V15zM9 12.75c.825 0 1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5-1.5.675-1.5 1.5.675 1.5 1.5 1.5z"/></symbol>
</svg>

<!--
Expand Down Expand Up @@ -435,7 +435,7 @@ <h2>unlock</h2>

</section>
<footer>
<p>Generated at Sun, 30 Jun 2019 21:17:39 GMT by <a href="https://github.com/jkphl/svg-sprite" target="_blank">svg-sprite</a>.</p>
<p>Generated at Sun, 21 Jul 2019 13:01:36 GMT by <a href="https://github.com/jkphl/svg-sprite" target="_blank">svg-sprite</a>.</p>
</footer>
</body>
</html>
2 changes: 1 addition & 1 deletion assets/icons/symbol/sprite.symbol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 61 additions & 11 deletions dist/leaflet.distortableimage.js

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions src/edit/DistortableImage.Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ L.DistortableImage = L.DistortableImage || {};

L.DistortableImage.Edit = L.Handler.extend({
options: {
opacity: 0.7,
outline: '1px solid red',
keymap: {
'Backspace': '_removeOverlay', // backspace windows / delete mac
Expand All @@ -27,8 +26,8 @@ L.DistortableImage.Edit = L.Handler.extend({
this._mode = modes[modes.indexOf(overlay.options.mode)] || 'distort';

this._selected = this._overlay.options.selected || false;
this._transparent = false;
this._outlined = false;
this._opacity = 1;

/* generate instance counts. TODO - add the keymapper to collection instead of individ. imgs perhaps? */
this.instance_count = L.DistortableImage.Edit.prototype.instances =
Expand Down Expand Up @@ -355,14 +354,12 @@ L.DistortableImage.Edit = L.Handler.extend({
},

_toggleTransparency: function() {
var image = this._overlay._image,
opacity;
var image = this._overlay._image;

this._transparent = !this._transparent;
opacity = this._transparent ? this.options.opacity : 1;
this._opacity = Math.round(this._opacity*10) === 1 ? 1 : this._opacity - 0.3;

L.DomUtil.setOpacity(image, opacity);
image.setAttribute('opacity', opacity);
L.DomUtil.setOpacity(image, this._opacity);
image.setAttribute('opacity', this._opacity);

this._showToolbar();
},
Expand Down
4 changes: 2 additions & 2 deletions src/edit/EditHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ L.EditHandle = L.Marker.extend({
{
dragstart: this._onHandleDragStart,
drag: this._onHandleDrag,
dragend: this._onHandleDragEnd
dragend: this._onHandleDragEnd,
},
this
);
Expand All @@ -65,7 +65,7 @@ L.EditHandle = L.Marker.extend({
{
dragstart: this._onHandleDragStart,
drag: this._onHandleDrag,
dragend: this._onHandleDragEnd
dragend: this._onHandleDragEnd,
},
this
);
Expand Down
55 changes: 54 additions & 1 deletion src/edit/LockHandle.js

Large diffs are not rendered by default.

0 comments on commit 4386c28

Please sign in to comment.