pl-fe: zoomable image fixes
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -40,10 +40,12 @@ const Blurhash: React.FC<IBlurhash> = React.memo(({
|
|||||||
try {
|
try {
|
||||||
const pixels = decode(hash, width, height);
|
const pixels = decode(hash, width, height);
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
const imageData = new ImageData(new Uint8ClampedArray(pixels), width, height);
|
const imageData = ctx?.createImageData(width, height);
|
||||||
|
imageData?.data.set(pixels);
|
||||||
|
|
||||||
if (!ctx) return;
|
if (imageData) {
|
||||||
ctx.putImageData(imageData, 0, 0);
|
ctx?.putImageData(imageData, 0, 0);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Blurhash decoding failure', { err, hash });
|
console.error('Blurhash decoding failure', { err, hash });
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.⁂-zoomable-image {
|
.⁂-zoomable-image {
|
||||||
@apply relative flex size-full items-center justify-center;
|
@apply relative flex size-full items-center justify-center overflow-hidden select-none;
|
||||||
|
scrollbar-width: none;
|
||||||
|
|
||||||
&--zoomed-in {
|
&--zoomed-in {
|
||||||
@apply cursor-grab z-[9999];
|
@apply cursor-grab z-[9999];
|
||||||
|
|||||||
Reference in New Issue
Block a user