Skip to content

Commit

Permalink
select tiepoints on create.
Browse files Browse the repository at this point in the history
fixes a bug initializing QuadraticTransform2 objects
  • Loading branch information
deleted committed Oct 17, 2012
1 parent 8ae9c61 commit 95f53ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion geocamTiePoint/static/geocamTiePoint/js/backbone/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ $(function($) {
assert(false, "Override me in a subclass!");
},

selectMarker: function(idx) {
_.each(this.markers, function(marker, i) {
marker.set('selected', i === idx);
});
},

handleClick: function(event) {
if (!_.isUndefined(window.draggingG) && draggingG) return;
assert(!_.isUndefined(window.actionPerformed), "Missing global actionPerformed(). Check for undo.js");
Expand All @@ -184,7 +190,7 @@ $(function($) {

this.markers.push(marker);
this.updateTiepointFromMarker(index, marker);
//imageCoordsG.push(coord);
this.selectMarker(index);
},

initGmapUIHandlers: function(){
Expand Down
8 changes: 6 additions & 2 deletions geocamTiePoint/static/geocamTiePoint/js/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,13 @@ $(function($) {
'quadratic': QuadraticTransform,
'quadratic2': QuadraticTransform2,
}
if (! transformJSON in classmap) throw "Unexpected transform type";
if (! transformJSON.type in classmap) throw "Unexpected transform type";
var transformClass = classmap[transformJSON.type];
return new transformClass( matrixFromNestedList(transformJSON.matrix) )
if ( transformClass === QuadraticTransform2 ) {
return new transformClass( matrixFromNestedList(transformJSON.matrix), transformJSON.quadraticTerms);
} else {
return new transformClass( matrixFromNestedList(transformJSON.matrix) );
}
}

/**********************************************************************
Expand Down

0 comments on commit 95f53ee

Please sign in to comment.