Skip to content

Commit

Permalink
#120 improved
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxew42 authored and cmaneu committed Feb 11, 2022
1 parent 0021268 commit 8d87522
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
20 changes: 15 additions & 5 deletions src/components/annotate/BoundingBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@
:allow-empty="false"
:searchable="false"
:style="DEVstyle"
:openDirection="openDirection"
:max-height="
$store.state.actualImageHeight - (y + height)
"
:open-direction="openDirection"
:max-height="optionMaxHeight"
></multiselect>
</div>
</template>
Expand Down Expand Up @@ -100,10 +98,22 @@ export default class BoundingBox extends Vue {
selected: false
};
}
get optionMaxHeight(): number {
if (this.openDirection == "top") {
return this.y + this.height;
} else {
return (
this.$store.state.boxOffset.y +
this.$store.state.actualImageHeight -
(this.y + this.height)
);
}
}
get openDirection(): string {
if (
this.y + this.height >=
(2 * this.$store.state.actualImageHeight) / 3
this.$store.state.actualImageHeight / 2 +
this.$store.state.boxOffset.y
) {
return "top";
} else {
Expand Down
5 changes: 4 additions & 1 deletion src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ const developmentAnnotationLabels: AnnotationLabel[] = [
{ id: 7, name: "unclear" },
{ id: 8, name: "insulating material" },
{ id: 9, name: "drum" },
{ id: 10, name: "trash #10" }
{ id: 10, name: "trash #10" },
{ id: 11, name: "trash #11" },
{ id: 12, name: "trash #12" },
{ id: 13, name: "trash #13" }
]; // TODO : Should be fetch from API
const savedAuth = localStorage.getItem("auth");

Expand Down

0 comments on commit 8d87522

Please sign in to comment.