Skip to content

Commit

Permalink
Merge pull request #258 from will-moore/fix_theZ_display_in_crop_dialog
Browse files Browse the repository at this point in the history
fix theZ display in crop dialog
  • Loading branch information
jburel authored Jan 12, 2018
2 parents d1492d4 + 859a5f1 commit 7afa6fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/views/crop_modal_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,18 @@ var CropModalView = Backbone.View.extend({
cachedRois[roi.id] = shapes;
// get display shape for picking ROI
// on current plane or pick median T/Z...
tkeys = _.keys(shapes).sort();
tkeys = _.keys(shapes)
.map(function(x){return parseInt(x, 10)})
.sort(function(a, b){return a - b}); // sort numerically
if (tkeys.length === 0) continue; // no Rectangles
if (shapes[currT]) {
t = currT;
} else {
t = tkeys[(tkeys.length/2)>>0]
}
zkeys = _.keys(shapes[t]).sort();
zkeys = _.keys(shapes[t])
.map(function(x){return parseInt(x, 10)})
.sort(function(a, b){return a - b}); // sort numerically
if (shapes[t][currZ]) {
z = currZ;
} else {
Expand Down

0 comments on commit 7afa6fd

Please sign in to comment.