ImageZoom Fixes

This commit is contained in:
Vendicated 2023-04-11 02:00:42 +02:00
parent c997cb4958
commit 358eb6ad8e
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
4 changed files with 12 additions and 17 deletions

View file

@ -36,7 +36,6 @@ export interface MagnifierProps {
export const Magnifier: React.FC<MagnifierProps> = ({ instance, size: initialSize, zoom: initalZoom }) => {
const [ready, setReady] = useState(false);
const [lensPosition, setLensPosition] = useState<Vec2>({ x: 0, y: 0 });
const [imagePosition, setImagePosition] = useState<Vec2>({ x: 0, y: 0 });
const [opacity, setOpacity] = useState(0);
@ -157,7 +156,7 @@ export const Magnifier: React.FC<MagnifierProps> = ({ instance, size: initialSiz
return (
<div
className="lens"
className="vc-imgzoom-lens"
style={{
opacity,
width: size.current + "px",
@ -190,7 +189,8 @@ export const Magnifier: React.FC<MagnifierProps> = ({ instance, size: initialSiz
}}
width={`${box.width * zoom.current}px`}
height={`${box.height * zoom.current}px`}
src={instance.props.src} alt=""
src={instance.props.src}
alt=""
/>
)}
</div>