Skip to content

Commit

Permalink
Changed indexing to start from 1
Browse files Browse the repository at this point in the history
  • Loading branch information
czxcjx committed Feb 7, 2015
1 parent 81f736c commit ec2f62f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/objects/templates/ImageWithRegionsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ oppia.directive('imageWithRegionsEditor', [
if ($scope.rectWidth != 0 && $scope.rectHeight != 0) {
var labels = $scope.$parent.value.imageRegions.map(function(region) {return region.label;});
var newLabel = null;
for (var i = 0; i <= labels.length; i++) {
for (var i = 1; i <= labels.length+1; i++) {
if (labels.indexOf(i.toString()) === -1) {
newLabel = i.toString();
break;
Expand Down

0 comments on commit ec2f62f

Please sign in to comment.