Add ranged input for overlay module. (#1459)

* add ranged input for overlay module

* fix bug

* change input type to integer

* Add tests

* Add tests

Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com>
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
This commit is contained in:
Rishabh Shukla
2020-01-17 01:37:35 +05:30
committed by Jeffrey Warren
parent 2736b481a4
commit b8c7df760a
4 changed files with 82 additions and 2 deletions

View File

@@ -4,6 +4,11 @@ module.exports = function Dynamic(options, UI, util) {
options.x = options.x || defaults.x;
options.y = options.y || defaults.y;
if(options.step.inBrowser && !options.noUI && sequencer.getSteps().length < 2)
options.offset = -1;
if (options.step.inBrowser && !options.noUI) var ui = require('./Ui.js')(options.step, UI);
var output;
// This function is called on every draw.
@@ -62,6 +67,13 @@ module.exports = function Dynamic(options, UI, util) {
step.output = { src: datauri, format: mimetype, wasmSuccess, useWasm: options.useWasm };
}
function modifiedCallback() {
if (options.step.inBrowser && !options.noUI) {
ui.setup();
}
callback();
}
// run PixelManipulation on first Image pixels
return require('../_nomodule/PixelManipulation.js')(baseStepOutput, {
output: output,
@@ -70,7 +82,7 @@ module.exports = function Dynamic(options, UI, util) {
format: baseStepOutput.format,
image: baseStepImage,
inBrowser: options.inBrowser,
callback: callback,
callback: modifiedCallback,
useWasm:options.useWasm
});
});