P5-2705 - public crop function can now remove aperture transparency
This commit is contained in:
Vendored
+7
-1
@@ -1337,7 +1337,9 @@ function ImageEditor(canvasId, args) {
|
|||||||
* @param {string} unit cm|inch
|
* @param {string} unit cm|inch
|
||||||
* @return {ImageEditor}
|
* @return {ImageEditor}
|
||||||
*/
|
*/
|
||||||
this.crop = function (width, height, unit) {
|
this.crop = function (width, height, unit, removeTransparency) {
|
||||||
|
removeTransparency = typeof removeTransparency !== 'undefined' ? removeTransparency : false;
|
||||||
|
|
||||||
if (!width || !height) {
|
if (!width || !height) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -1354,6 +1356,10 @@ function ImageEditor(canvasId, args) {
|
|||||||
_canvas.getImage().__cropped = false;
|
_canvas.getImage().__cropped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (removeTransparency) {
|
||||||
|
_canvas.getApertures().setTransparent(false);
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -99,7 +99,9 @@ function ImageEditor(canvasId, args) {
|
|||||||
* @param {string} unit cm|inch
|
* @param {string} unit cm|inch
|
||||||
* @return {ImageEditor}
|
* @return {ImageEditor}
|
||||||
*/
|
*/
|
||||||
this.crop = function (width, height, unit) {
|
this.crop = function (width, height, unit, removeTransparency) {
|
||||||
|
removeTransparency = typeof removeTransparency !== 'undefined' ? removeTransparency : false;
|
||||||
|
|
||||||
if (!width || !height) {
|
if (!width || !height) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -116,6 +118,10 @@ function ImageEditor(canvasId, args) {
|
|||||||
_canvas.getImage().__cropped = false;
|
_canvas.getImage().__cropped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (removeTransparency) {
|
||||||
|
_canvas.getApertures().setTransparent(false);
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user