This commit is contained in:
Chinmay Pandhare
2017-07-07 02:17:11 +05:30
parent 9a17116aff
commit b0a21ffd3e
3 changed files with 0 additions and 27 deletions

View File

@@ -138,13 +138,6 @@ sequencer.insertSteps({
});
```
### Replacing an Image
An existing image can be replaced with another image, retaining the steps of the initial image. This has a very straightforward syntax.
```js
sequencer.replaceImage('image_name',image_src);
```
## Contributing
Happily accepting pull requests; to edit the core library, modify files in `/src/`. To build, run `npm install` and `grunt build`.

View File

@@ -125,13 +125,6 @@ ImageSequencer = function ImageSequencer(options) {
json_q.callback();
}
function replaceImage(image,src) {
this_ = this;
this_.images[image].steps[0].draw(src,function(){
this_.run();
});
}
return {
options: options,
loadImages: loadImages,

View File

@@ -108,16 +108,3 @@ test('run() runs the sequencer', function (t) {
t.equal(typeof(sequencer.images.test.steps[sequencer.images.test.steps.length - 1].output), "object", "It Does!");
t.end();
});
test('replaceImage() replaces the image and runs the sequencer', function (t) {
var testarray = [];
for (i in sequencer.images.test.steps) {
testarray.push(sequencer.images.test.steps[i].output.src);
}
t.equal(true,true);
sequencer.replaceImage('test','examples/cyan.jpg');
for (i in testarray) {
t.notEqual(testarray[i],sequencer.images.test.steps[i].output.src);
}
t.end();
});