Skip to content

Commit 6cbd7f0

Browse files
committed
fix anti aliasing and remove shadow from sidebar when closed
1 parent 8334367 commit 6cbd7f0

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

addons/gst-web-core/selkies-core.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,15 @@ const updateCanvasImageRendering = () => {
336336
}
337337
return;
338338
}
339-
const rect = canvas.getBoundingClientRect();
340339
const dpr = window.devicePixelRatio || 1;
341-
const isStretched = Math.round(rect.width * dpr) !== canvas.width || Math.round(rect.height * dpr) !== canvas.height;
342-
if (isStretched) {
340+
if (window.isManualResolutionMode || (useCssScaling && dpr > 1)) {
343341
if (canvas.style.imageRendering !== 'auto') {
344-
console.log(`Canvas is scaled (${canvas.width}x${canvas.height} buffer -> ${rect.width.toFixed(0)}x${rect.height.toFixed(0)} display). Setting rendering to 'auto'.`);
342+
console.log("Smoothing enabled for manual resolution or high-DPR scaling.");
345343
canvas.style.imageRendering = 'auto';
346344
}
347345
} else {
348346
if (canvas.style.imageRendering !== 'pixelated') {
349-
console.log("Canvas is 1:1. Setting rendering to 'pixelated'.");
347+
console.log("Setting canvas rendering to 'pixelated' for 1:1 display.");
350348
canvas.style.imageRendering = 'pixelated';
351349
canvas.style.setProperty('image-rendering', 'crisp-edges', '');
352350
}

addons/selkies-dashboard/src/styles/Overlay.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@
9191
width: 280px;
9292
height: calc(var(--vh, 1vh) * 100);
9393
background-color: var(--sidebar-bg);
94-
box-shadow: 2px 0 5px var(--sidebar-shadow);
9594
transform: translateX(-100%);
96-
transition: transform 0.3s ease-in-out, background-color 0.3s ease, color 0.3s ease;
95+
transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, background-color 0.3s ease, color 0.3s ease;
9796
z-index: 1010;
9897
padding: 20px;
9998
box-sizing: border-box;
@@ -106,6 +105,7 @@
106105
/* State when the sidebar is open. */
107106
.sidebar.is-open {
108107
transform: translateX(0);
108+
box-shadow: 2px 0 5px var(--sidebar-shadow);
109109
}
110110

111111
/* --- Sidebar Header --- */

0 commit comments

Comments
 (0)