Skip to content

Commit

Permalink
always show rack owner label if showing name label in irv
Browse files Browse the repository at this point in the history
  • Loading branch information
timalces committed Mar 12, 2024
1 parent 01a7c07 commit c88f5ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/javascript/canvas/irv/view/Rack.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,14 @@ class Rack extends RackObject {
})();
}

draw(show_u_labels, show_name_label, show_owner_label) {
draw(show_u_labels, show_name_label) {
Profiler.begin(Profiler.DEBUG, this.draw);
// clear
for (var asset of Array.from(this.assets)) { RackObject.RACK_GFX.remove(asset); }
this.assets = [];

// add labels as necessary
this.showOwnerLabel(show_owner_label);
this.showOwnerLabel(show_name_label);
this.showNameLabel(show_name_label);
this.showULabels(show_u_labels);

Expand Down
6 changes: 2 additions & 4 deletions app/javascript/canvas/irv/view/RackSpace.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,8 @@ class RackSpace {

const show_u_labels = this.scale >= RackSpace.U_LBL_SCALE_CUTOFF;
const show_name_label = this.scale >= RackSpace.NAME_LBL_SCALE_CUTOFF;
const show_owner_label = show_name_label;
if (this.model.showingRacks()) {
for (var rack of Array.from(this.racks)) { rack.draw(show_u_labels, show_name_label, show_owner_label); }
for (var rack of Array.from(this.racks)) { rack.draw(show_u_labels, show_name_label); }
this.updateRackImage();
}
if (this.model.showHoldingArea()) {
Expand Down Expand Up @@ -1013,11 +1012,10 @@ class RackSpace {
evHalfFlipped(img_id) {
const show_u_labels = this.scale >= RackSpace.U_LBL_SCALE_CUTOFF;
const show_name_label = this.scale >= RackSpace.NAME_LBL_SCALE_CUTOFF;
const show_owner_label = show_name_label;

// redraw the rack in the (hidden) rack layer, since the rack image in the fx layer is a slice of the rack layer it will automatically
// reflect the changes
this.rackLookup[img_id].draw(show_u_labels, show_name_label, show_owner_label);
this.rackLookup[img_id].draw(show_u_labels, show_name_label);

const x = this.fx.getAttribute(img_id, 'x');
const width = this.fx.getAttribute(img_id, 'sliceWidth');
Expand Down

0 comments on commit c88f5ff

Please sign in to comment.