diff options
author | V <vendicated@riseup.net> | 2023-06-30 15:50:56 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-06-30 15:50:56 +0200 |
commit | b607eebcb709daee421aba4e19d7729e4766b974 (patch) | |
tree | 9beaa5ce04c97e1e6b13f14d9dca6c20bf6606f9 /src/plugins/imageZoom/components | |
parent | 0936ca29856507891397739a92feced62aba5876 (diff) | |
download | Vencord-b607eebcb709daee421aba4e19d7729e4766b974.tar.gz Vencord-b607eebcb709daee421aba4e19d7729e4766b974.tar.bz2 Vencord-b607eebcb709daee421aba4e19d7729e4766b974.zip |
ImageZoom: Add square lens option
Diffstat (limited to 'src/plugins/imageZoom/components')
-rw-r--r-- | src/plugins/imageZoom/components/Magnifier.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/imageZoom/components/Magnifier.tsx b/src/plugins/imageZoom/components/Magnifier.tsx index 4e5b667..6a3fc05 100644 --- a/src/plugins/imageZoom/components/Magnifier.tsx +++ b/src/plugins/imageZoom/components/Magnifier.tsx @@ -16,6 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import { classNameFactory } from "@api/Styles"; import { FluxDispatcher, React, useRef, useState } from "@webpack/common"; import { ELEMENT_ID } from "../constants"; @@ -33,6 +34,8 @@ export interface MagnifierProps { instance: any; } +const cl = classNameFactory("vc-imgzoom-"); + export const Magnifier: React.FC<MagnifierProps> = ({ instance, size: initialSize, zoom: initalZoom }) => { const [ready, setReady] = useState(false); @@ -156,7 +159,7 @@ export const Magnifier: React.FC<MagnifierProps> = ({ instance, size: initialSiz return ( <div - className={`vc-imgzoom-lens ${settings.store.nearestNeighbour ? "nearest-neighbor" : ""}`} + className={cl("lens", { "nearest-neighbor": settings.store.nearestNeighbour, square: settings.store.square })} style={{ opacity, width: size.current + "px", |