rewrite overlay: spacer-based titlebar layout for close button, 200ms debounce + 100ms skip for aspect ratio enforcement, event-based ratio sync
This commit is contained in:
+4
-4
@@ -458,6 +458,7 @@
|
||||
<button class="chip" onclick={() => {
|
||||
aspectLock = w / h
|
||||
api.setOverlayAspect(aspectLock)
|
||||
emit("overlay-set-ratio", { ratio: aspectLock })
|
||||
api.setOverlaySize(w, h)
|
||||
}}>{label}</button>
|
||||
{/each}
|
||||
@@ -465,6 +466,7 @@
|
||||
<button class="chip unlock" onclick={() => {
|
||||
aspectLock = null
|
||||
api.setOverlayAspect(null)
|
||||
emit("overlay-set-ratio", { ratio: null })
|
||||
}}>Unlock</button>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -532,11 +534,9 @@
|
||||
</div>
|
||||
|
||||
<!-- Preview -->
|
||||
{@const displayPath = dragging && trimPreviewPath ? trimPreviewPath : previewPath}
|
||||
{@const displayBust = dragging && trimPreviewPath ? trimPreviewBust : previewCacheBust}
|
||||
{#if displayPath}
|
||||
{#if (dragging && trimPreviewPath ? trimPreviewPath : previewPath)}
|
||||
<div class="preview-box">
|
||||
<img src={convertFileSrc(displayPath) + "?t=" + displayBust} alt="preview frame" class="preview-img"/>
|
||||
<img src={convertFileSrc(dragging && trimPreviewPath ? trimPreviewPath : previewPath) + "?t=" + (dragging && trimPreviewPath ? trimPreviewBust : previewCacheBust)} alt="preview frame" class="preview-img"/>
|
||||
{#if previewLoading && !dragging}<div class="preview-loading">rendering</div>{/if}
|
||||
{#if dragging}<div class="preview-loading">original</div>{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user