Skip to content

Commit f62c00f

Browse files
committed
feat: minimum size
1 parent eba754f commit f62c00f

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

public/settings.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ window.settings = {
3535
*/
3636
direction: "top",
3737

38+
/**
39+
* Minimum size, in pixels, of the displayed image.
40+
* @type {Number}
41+
*/
42+
minSize: 200,
43+
3844
/**
3945
* Maximum size, in pixels, of the displayed image.
4046
* @type {Number}

src/components/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ const App: FC = () => {
151151
ref={imageRef}
152152
className={styles.image}
153153
style={{
154+
minHeight: `${settings.minSize}px`,
155+
minWidth: `${settings.minSize}px`,
154156
maxHeight: `${settings.maxSize}px`,
155157
maxWidth: `${settings.maxSize}px`,
156158
}}

src/types/settings.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ export interface Settings {
2424
*/
2525
direction: "top" | "right" | "bottom" | "left";
2626

27+
/**
28+
* Minimum size, in pixels, of the displayed image.
29+
*/
30+
minSize: number;
31+
2732
/**
2833
* Maximum size, in pixels, of the displayed image.
2934
*/

0 commit comments

Comments
 (0)