Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Miłosz Sobczak
image-mask-cropper
Commits
69353a5f
Commit
69353a5f
authored
9 years ago
by
Miłosz Sobczak
Browse files
Options
Download
Email Patches
Plain Diff
changes way of changing mask options
parent
1fec8288
master
1.5.4
1.5.3
v1.5.12
v1.5.11
v1.5.10
v1.5.9
v1.5.8
v1.5.7
v1.5.6
v1.5.5
v1.5.4
v1.5.3
v1.5.2
v1.5.1
v1.5.0
No related merge requests found
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
bower.json
+1
-1
bower.json
dist/image-mask-cropper.js
+20
-11
dist/image-mask-cropper.js
dist/image-mask-cropper.min.js
+1
-1
dist/image-mask-cropper.min.js
package.json
+1
-1
package.json
src/image-mask-cropper.js
+20
-11
src/image-mask-cropper.js
with
43 additions
and
25 deletions
+43
-25
bower.json
View file @
69353a5f
{
"name"
:
"image-mask-cropper"
,
"version"
:
"1.
4.9
"
,
"version"
:
"1.
5.0
"
,
"homepage"
:
"http://gl.pixers.pl:8080/milosz.sobczak/image-mask-cropper/tree/master"
,
"authors"
:
[
"milosz.sobczak@pixers.pl"
...
...
This diff is collapsed.
Click to expand it.
dist/image-mask-cropper.js
View file @
69353a5f
...
...
@@ -177,7 +177,7 @@
return
false
;
}
this
.
options
.
maskOptions
=
$
.
extend
(
true
,
this
.
options
.
maskOptions
,
maskOptions
);
this
.
_init
(
);
this
.
setPositionCoords
(
this
.
_getPositionCoordsValid
(
this
.
options
.
maskOptions
)
);
},
/**
* Gets coordinatates of crop.
...
...
@@ -258,11 +258,8 @@
* @return {void}
*/
setMaskOptionsHeight
:
function
(
height
)
{
var
yDiff
=
Math
.
max
((
this
.
options
.
positionCoords
.
y
+
this
.
_setMaskOptionsHeight
(
height
))
-
100
,
0
);
this
.
setPositionCoords
({
y
:
this
.
options
.
positionCoords
.
y
+
yDiff
});
this
.
_setMaskOptionsHeight
(
height
);
this
.
setPositionCoords
(
this
.
_getPositionCoordsValid
(
this
.
options
.
maskOptions
));
},
/**
* Setter.
...
...
@@ -271,11 +268,8 @@
* @return {void}
*/
setMaskOptionsWidth
:
function
(
width
)
{
var
xDiff
=
Math
.
max
((
this
.
options
.
positionCoords
.
x
+
this
.
_setMaskOptionsWidth
(
width
))
-
100
,
0
);
this
.
setPositionCoords
({
x
:
this
.
options
.
positionCoords
.
x
+
xDiff
});
this
.
_setMaskOptionsWidth
(
width
)
this
.
setPositionCoords
(
this
.
_getPositionCoordsValid
(
this
.
options
.
maskOptions
));
},
/**
* Enables crop plugin option.
...
...
@@ -299,6 +293,21 @@
this
.
options
.
enableCrop
=
false
;
this
.
_updateContainerClass
();
},
/**
* Gets valid position coords based on mask options.
*
* @param {object} maskOptions
* @return {object} crop positions
*/
_getPositionCoordsValid
:
function
(
maskOptions
)
{
var
xDiff
=
Math
.
max
((
this
.
options
.
positionCoords
.
x
+
maskOptions
.
width
)
-
100
,
0
),
yDiff
=
Math
.
max
((
this
.
options
.
positionCoords
.
y
+
maskOptions
.
height
)
-
100
,
0
);
return
{
x
:
this
.
options
.
positionCoords
.
x
+
xDiff
,
y
:
this
.
options
.
positionCoords
.
y
+
yDiff
};
},
/**
* Triggers callback func when crop is moved.
* @return {void}
...
...
This diff is collapsed.
Click to expand it.
dist/image-mask-cropper.min.js
View file @
69353a5f
This diff is collapsed.
Click to expand it.
package.json
View file @
69353a5f
{
"name"
:
"image-mask-cropper"
,
"description"
:
"Jquery library that gives you ability to move images across container using mask as well"
,
"version"
:
"1.
4.9
"
,
"version"
:
"1.
5.0
"
,
"author"
:
"Miłosz Sobczak <milosz.sobczak@pixers.pl>"
,
"devDependencies"
:
{
"
gulp
"
:
"
3.9.0
"
,
...
...
This diff is collapsed.
Click to expand it.
src/image-mask-cropper.js
View file @
69353a5f
...
...
@@ -177,7 +177,7 @@
return
false
;
}
this
.
options
.
maskOptions
=
$
.
extend
(
true
,
this
.
options
.
maskOptions
,
maskOptions
);
this
.
_init
(
);
this
.
setPositionCoords
(
this
.
_getPositionCoordsValid
(
this
.
options
.
maskOptions
)
);
},
/**
* Gets coordinatates of crop.
...
...
@@ -258,11 +258,8 @@
* @return {void}
*/
setMaskOptionsHeight
:
function
(
height
)
{
var
yDiff
=
Math
.
max
((
this
.
options
.
positionCoords
.
y
+
this
.
_setMaskOptionsHeight
(
height
))
-
100
,
0
);
this
.
setPositionCoords
({
y
:
this
.
options
.
positionCoords
.
y
+
yDiff
});
this
.
_setMaskOptionsHeight
(
height
);
this
.
setPositionCoords
(
this
.
_getPositionCoordsValid
(
this
.
options
.
maskOptions
));
},
/**
* Setter.
...
...
@@ -271,11 +268,8 @@
* @return {void}
*/
setMaskOptionsWidth
:
function
(
width
)
{
var
xDiff
=
Math
.
max
((
this
.
options
.
positionCoords
.
x
+
this
.
_setMaskOptionsWidth
(
width
))
-
100
,
0
);
this
.
setPositionCoords
({
x
:
this
.
options
.
positionCoords
.
x
+
xDiff
});
this
.
_setMaskOptionsWidth
(
width
)
this
.
setPositionCoords
(
this
.
_getPositionCoordsValid
(
this
.
options
.
maskOptions
));
},
/**
* Enables crop plugin option.
...
...
@@ -299,6 +293,21 @@
this
.
options
.
enableCrop
=
false
;
this
.
_updateContainerClass
();
},
/**
* Gets valid position coords based on mask options.
*
* @param {object} maskOptions
* @return {object} crop positions
*/
_getPositionCoordsValid
:
function
(
maskOptions
)
{
var
xDiff
=
Math
.
max
((
this
.
options
.
positionCoords
.
x
+
maskOptions
.
width
)
-
100
,
0
),
yDiff
=
Math
.
max
((
this
.
options
.
positionCoords
.
y
+
maskOptions
.
height
)
-
100
,
0
);
return
{
x
:
this
.
options
.
positionCoords
.
x
+
xDiff
,
y
:
this
.
options
.
positionCoords
.
y
+
yDiff
};
},
/**
* Triggers callback func when crop is moved.
* @return {void}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help