Fix layers insert mark disappearing (#1493)

* Fix layers insert mark disappearing

* Move insertion line up 1px

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube 2023-12-09 13:34:15 +00:00 committed by GitHub
parent bd9647eb54
commit 99823e952a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -181,7 +181,7 @@
else if (distance > -closest && distance > -RANGE_TO_INSERT_WITHIN_BOTTOM_FOLDER_NOT_ROOT && distance < 0) { else if (distance > -closest && distance > -RANGE_TO_INSERT_WITHIN_BOTTOM_FOLDER_NOT_ROOT && distance < 0) {
insertFolder = isGroupOrArtboard(layer.layerType) ? layer.path : layer.path.slice(0, layer.path.length - 1); insertFolder = isGroupOrArtboard(layer.layerType) ? layer.path : layer.path.slice(0, layer.path.length - 1);
insertIndex = isGroupOrArtboard(layer.layerType) ? 0 : folderIndex + 1; insertIndex = isGroupOrArtboard(layer.layerType) ? 0 : folderIndex + 1;
highlightFolder = isGroupOrArtboard("Folder"); highlightFolder = isGroupOrArtboard(layer.layerType);
closest = -distance; closest = -distance;
markerHeight = index === treeChildren.length - 1 ? rect.bottom - INSERT_MARK_OFFSET : rect.bottom; markerHeight = index === treeChildren.length - 1 ? rect.bottom - INSERT_MARK_OFFSET : rect.bottom;
} }
@ -356,7 +356,7 @@
{/each} {/each}
</LayoutCol> </LayoutCol>
{#if draggingData && !draggingData.highlightFolder && dragInPanel} {#if draggingData && !draggingData.highlightFolder && dragInPanel}
<div class="insert-mark" style:top={`${draggingData.markerHeight}px`} /> <div class="insert-mark" style:left={`${4 + draggingData.insertFolder.length * 16}px`} style:top={`${draggingData.markerHeight}px`} />
{/if} {/if}
</LayoutRow> </LayoutRow>
</LayoutCol> </LayoutCol>
@ -523,7 +523,7 @@
left: 4px; left: 4px;
right: 4px; right: 4px;
background: var(--color-e-nearwhite); background: var(--color-e-nearwhite);
margin-top: -2px; margin-top: -3px;
height: 5px; height: 5px;
z-index: 1; z-index: 1;
pointer-events: none; pointer-events: none;