Skip to content

Commit

Permalink
Merge pull request #1332 from opencv/bs/fixed_z_order_computing
Browse files Browse the repository at this point in the history
Fixed zOrder range computing in case when there are tags
  • Loading branch information
ActiveChooN authored Mar 30, 2020
2 parents 65b1b5c + 2775c8f commit ddf452c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cvat-ui/src/actions/annotation-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,10 @@ function receiveAnnotationsParameters(): AnnotationsParameters {
}

export function computeZRange(states: any[]): number[] {
let minZ = states.length ? states[0].zOrder : 0;
let maxZ = states.length ? states[0].zOrder : 0;
states.forEach((state: any): void => {
if (state.objectType === ObjectType.TAG) {
return;
}

const filteredStates = states.filter((state: any): any => state.objectType !== ObjectType.TAG);
let minZ = filteredStates.length ? filteredStates[0].zOrder : 0;
let maxZ = filteredStates.length ? filteredStates[0].zOrder : 0;
filteredStates.forEach((state: any): void => {
minZ = Math.min(minZ, state.zOrder);
maxZ = Math.max(maxZ, state.zOrder);
});
Expand Down

0 comments on commit ddf452c

Please sign in to comment.