Skip to content

Commit

Permalink
fix(UI - layer_list_panel): Change layer number width spacing to cons…
Browse files Browse the repository at this point in the history
…ider archived layers (#748)
  • Loading branch information
seankmartin authored Mar 5, 2025
1 parent 075eade commit 7681ed7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ui/layer_list_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,7 @@ export class LayerListPanel extends SidePanel {
for (const layer of self.layerManager.managedLayers) {
if (!layer.archived) ++numNonArchivedLayers;
}
const numberElementWidth = `${
(numNonArchivedLayers + 1).toString().length
}ch`;
const numberElementWidth = `${numNonArchivedLayers.toString().length}ch`;
for (const layer of self.layerManager.managedLayers) {
if (layer.visible) {
++numVisible;
Expand All @@ -296,7 +294,7 @@ export class LayerListPanel extends SidePanel {
}
const { nonArchivedLayerIndex } = layer;
item.numberElement.style.width = numberElementWidth;
if (nonArchivedLayerIndex === -1) {
if (layer.archived) {
item.numberElement.style.visibility = "hidden";
} else {
item.numberElement.style.visibility = "";
Expand Down

0 comments on commit 7681ed7

Please sign in to comment.