Skip to content

Commit

Permalink
version 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielarchanjo committed Dec 12, 2017
1 parent 51f33ca commit 35da1f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -271,12 +271,12 @@ MarvinImage.copyColorArray = function(imgSource, imgDestine){
if(imgSource.getColorModel() == imgDestine.getColorModel()){
switch(imgSource.getColorModel()){
case MarvinImage.COLOR_MODEL_RGB:
for(var i in imgSource.imageData.data){
for(var i=0; i<imgSource.imageData.data.length; i++){
imgDestine.imageData.data[i] = imgSource.imageData.data[i];
}
break;
case MarvinImage.COLOR_MODEL_BINARY:
for(var i in imgSource.arrBinaryColor){
for(var i=0; i<imgSource.arrBinaryColor.length; i++){
imgDestine.arrBinaryColor[i] = imgSource.arrBinaryColor[i];
}
break;
Expand Down
8 changes: 6 additions & 2 deletions marvinj/src/image/MarvinImage.js
Expand Up @@ -150,10 +150,14 @@ MarvinImage.copyColorArray = function(imgSource, imgDestine){
if(imgSource.getColorModel() == imgDestine.getColorModel()){
switch(imgSource.getColorModel()){
case MarvinImage.COLOR_MODEL_RGB:
imgDestine.imageData.data = imgSource.imageData.data.slice(0);
for(var i=0; i<imgSource.imageData.data.length; i++){
imgDestine.imageData.data[i] = imgSource.imageData.data[i];
}
break;
case MarvinImage.COLOR_MODEL_BINARY:
imgDestine.arrBinaryColor = imgSource.arrBinaryColor.slice(0);
for(var i=0; i<imgSource.arrBinaryColor.length; i++){
imgDestine.arrBinaryColor[i] = imgSource.arrBinaryColor[i];
}
break;
}
}
Expand Down

0 comments on commit 35da1f2

Please sign in to comment.