Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance of frame changing has been increased due to UI containers… #46

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cvat/apps/engine/static/engine/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ html {
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
padding: 3px 0px;
transition: 0.3s;

}

.tab button:hover {
Expand Down
15 changes: 14 additions & 1 deletion cvat/apps/engine/static/engine/js/shapeCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1247,8 +1247,17 @@ class ShapeCollectionView {
view.erase();
}

this._currentViews = [];
// Save parents and detach elements from DOM
// in order to increase performance in the buildShapeView function
let parents = {
uis: this._UIContent.parent(),
shapes: this._frameContent.node.parentNode
}

this._frameContent.node.parent = null;
this._UIContent.detach();

this._currentViews = [];
for (let shape of collection.currentShapes) {
let model = shape.model;
let view = buildShapeView(model, buildShapeController(model), this._frameContent, this._UIContent);
Expand All @@ -1259,6 +1268,10 @@ class ShapeCollectionView {
view.subscribe(this);
this._labelsContent.find(`.labelContentElement[label_id="${model.label}"]`).removeClass('hidden');
}

parents.shapes.append(this._frameContent.node);
parents.uis.prepend(this._UIContent);

ShapeCollectionView.sortByZOrder();
}

Expand Down
7 changes: 6 additions & 1 deletion cvat/apps/engine/static/engine/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@
.customizedTab {
border-radius: 5px 5px 0px 0px;
width: 100%;
width: 15%;
float: left;
margin: 0px 10px;
}

/* ----------------------- IDs ----------------------- */
Expand Down Expand Up @@ -392,7 +395,9 @@
}

#uiContent, #trackManagement, #aamMenu, #labelsContent {
border: 1px black solid;
border-bottom: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0,0,0,0.5);
background-color: #B0C4DE;
Expand Down
9 changes: 5 additions & 4 deletions cvat/apps/engine/templates/engine/annotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,12 @@
</div>
</div>


<div class="tab customizedTab">
<button class="h2 regular activeTabButton" id="sidePanelObjectsButton" style="width: 50%">Objects</button>
<button class="h2 regular" id="sidePanelLabelsButton" style="width: 50%">Labels</button>
</div>
<div id="taskAnnotationRightPanel">
<div class="tab customizedTab">
<button class="h2 regular activeTabButton" id="sidePanelObjectsButton" style="width: 50%">Objects</button>
<button class="h2 regular" id="sidePanelLabelsButton" style="width: 50%">Labels</button>
</div>
<div id="uiContent"> </div>
<div id="labelsContent" class="hidden"> </div>
<div id="trackManagement">
Expand Down