From 5e33ab2c2f56b83aae4c8387439cb4bdca0f8877 Mon Sep 17 00:00:00 2001
From: Nayam Amarshe <25067102+NayamAmarshe@users.noreply.github.com>
Date: Sat, 24 Dec 2022 13:10:45 +0530
Subject: [PATCH] Added image options
---
renderer/components/ImageOptions.tsx | 116 ++++++++++-----------
renderer/components/LeftPaneImageSteps.tsx | 4 +-
renderer/pages/index.tsx | 43 +++++---
3 files changed, 86 insertions(+), 77 deletions(-)
diff --git a/renderer/components/ImageOptions.tsx b/renderer/components/ImageOptions.tsx
index cd6f122..ef28513 100644
--- a/renderer/components/ImageOptions.tsx
+++ b/renderer/components/ImageOptions.tsx
@@ -3,15 +3,13 @@ import React, { useEffect } from "react";
const ImageOptions = ({
zoomAmount,
setZoomAmount,
- leftImageRef,
- rightImageRef,
resetImagePaths,
+ hideZoomOptions,
}: {
zoomAmount: string;
setZoomAmount: (arg: any) => void;
- leftImageRef: React.RefObject;
- rightImageRef: React.RefObject;
resetImagePaths: () => void;
+ hideZoomOptions?: boolean;
}) => {
useEffect(() => {
if (!localStorage.getItem("zoomAmount")) {
@@ -22,7 +20,7 @@ const ImageOptions = ({
}, []);
return (
-
+
Show/Hide Image Settings
@@ -33,59 +31,61 @@ const ImageOptions = ({
-
-
Zoom:
-
-
-
-
-
-
+ {!hideZoomOptions && (
+
+
Zoom:
+
+
+
+
+
+
+ )}
diff --git a/renderer/components/LeftPaneImageSteps.tsx b/renderer/components/LeftPaneImageSteps.tsx
index a5332ea..d0fad10 100644
--- a/renderer/components/LeftPaneImageSteps.tsx
+++ b/renderer/components/LeftPaneImageSteps.tsx
@@ -24,7 +24,6 @@ interface IProps {
setSaveImageAs: (arg: string) => void;
gpuId: string;
setGpuId: (arg: string) => void;
- leftImageRef: any;
dimensions: {
width: number | null;
height: number | null;
@@ -230,7 +229,8 @@ function LeftPaneImageSteps({
{" "}
to{" "}
- {dimensions.width * 4}x{dimensions.height * 4}
+ {doubleUpscayl ? dimensions.width * 8 : dimensions.width * 4}x
+ {doubleUpscayl ? dimensions.height * 8 : dimensions.height * 4}
)}
diff --git a/renderer/pages/index.tsx b/renderer/pages/index.tsx
index 752ab9d..3b6a658 100644
--- a/renderer/pages/index.tsx
+++ b/renderer/pages/index.tsx
@@ -499,21 +499,29 @@ const Home = () => {
!isVideo &&
upscaledImagePath.length === 0 &&
imagePath.length > 0 && (
- {
- setDimensions({
- width: e.target.naturalWidth,
- height: e.target.naturalHeight,
- });
- }}
- draggable="false"
- alt=""
- />
+ <>
+
+ {
+ setDimensions({
+ width: e.target.naturalWidth,
+ height: e.target.naturalHeight,
+ });
+ }}
+ draggable="false"
+ alt=""
+ className={`h-full w-full bg-[#1d1c23] object-contain`}
+ />
+ >
)}
{/* BATCH UPSCALE SHOW SELECTED FOLDER */}
@@ -562,9 +570,10 @@ const Home = () => {
{
alt="Upscayl"
style={{
objectFit: "contain",
- backgroundPosition: "0% 10%",
+ backgroundPosition: "0% 0%",
transformOrigin: backgroundPosition,
}}
onMouseMove={handleMouseMove}