Fix to use always the first param as timeout if only that one was provided while keeping backwards compatability with 2 params.

This commit is contained in:
Edgar O Silva 2014-01-07 20:36:08 -06:00
parent c7ae7140ea
commit db3322ebcd

View File

@ -74,10 +74,12 @@ NamedWindow::BlockingWaitKey(const v8::Arguments& args){
//SETUP_FUNCTION(NamedWindow)
int time = 0;
if (args.Length() > 0){
if (args.Length() > 1){
time = args[1]->IntegerValue();
}else{
time = args[0]->IntegerValue();
if (args.Length() > 0){
time = args[0]->IntegerValue();
}
}
int res = cv::waitKey(time);