Desktop: Fix the Text tool not working with the hole punch (#3012)
* Make viewport element transparent when hole punch is enabled Instead of removing the viewport element completely we make it transparent Allows the text tool to work * Fix formatting
This commit is contained in:
parent
5d17f5dcce
commit
b491cfcd2b
|
|
@ -533,16 +533,24 @@
|
|||
y={cursorTop}
|
||||
/>
|
||||
{/if}
|
||||
<div
|
||||
class:viewport={!$appWindow.viewportHolePunch}
|
||||
class:viewport-transparent={$appWindow.viewportHolePunch}
|
||||
on:pointerdown={(e) => canvasPointerDown(e)}
|
||||
bind:this={viewport}
|
||||
data-viewport
|
||||
>
|
||||
{#if !$appWindow.viewportHolePunch}
|
||||
<div class="viewport" on:pointerdown={(e) => canvasPointerDown(e)} bind:this={viewport} data-viewport>
|
||||
<svg class="artboards" style:width={canvasWidthCSS} style:height={canvasHeightCSS}>
|
||||
{@html artworkSvg}
|
||||
</svg>
|
||||
{/if}
|
||||
<div class="text-input" style:width={canvasWidthCSS} style:height={canvasHeightCSS} style:pointer-events={showTextInput ? "auto" : ""}>
|
||||
{#if showTextInput}
|
||||
<div bind:this={textInput} style:transform="matrix({textInputMatrix})" on:scroll={preventTextEditingScroll} />
|
||||
{/if}
|
||||
</div>
|
||||
{#if !$appWindow.viewportHolePunch}
|
||||
<canvas
|
||||
class="overlays"
|
||||
width={canvasWidthScaledRoundedToEven}
|
||||
|
|
@ -552,8 +560,9 @@
|
|||
data-overlays-canvas
|
||||
>
|
||||
</canvas>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="graph-view" class:open={$document.graphViewOverlayOpen} style:--fade-artwork={`${$document.fadeArtwork}%`} data-graph>
|
||||
<Graph />
|
||||
</div>
|
||||
|
|
@ -757,6 +766,10 @@
|
|||
|
||||
.viewport {
|
||||
background: var(--color-2-mildblack);
|
||||
}
|
||||
|
||||
.viewport,
|
||||
.viewport-transparent {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
// Allows the SVG to be placed at explicit integer values of width and height to prevent non-pixel-perfect SVG scaling
|
||||
|
|
|
|||
Loading…
Reference in New Issue