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,11 +74,13 @@ NamedWindow::BlockingWaitKey(const v8::Arguments& args){
//SETUP_FUNCTION(NamedWindow) //SETUP_FUNCTION(NamedWindow)
int time = 0; int time = 0;
if (args.Length() > 0){ if (args.Length() > 1){
time = args[1]->IntegerValue(); time = args[1]->IntegerValue();
}else{ }else{
if (args.Length() > 0){
time = args[0]->IntegerValue(); time = args[0]->IntegerValue();
} }
}
int res = cv::waitKey(time); int res = cv::waitKey(time);