split background and a4 + scale a4 in every size
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
const A4_WIDTH = 794;
|
||||
const A4_HEIGHT = 1123;
|
||||
export const A4_WIDTH = 794;
|
||||
export const A4_HEIGHT = 1123;
|
||||
const SCALE = 0.8;
|
||||
|
||||
export const useStageSize = () => {
|
||||
const [stageSize, setStageSize] = useState({
|
||||
width: A4_WIDTH * SCALE,
|
||||
height: A4_HEIGHT * SCALE,
|
||||
width: A4_WIDTH,
|
||||
height: A4_HEIGHT,
|
||||
scale: SCALE,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
@@ -19,8 +20,9 @@ export const useStageSize = () => {
|
||||
const newScale = Math.min(scaleX, scaleY, SCALE);
|
||||
|
||||
setStageSize({
|
||||
width: A4_WIDTH * newScale,
|
||||
height: A4_HEIGHT * newScale,
|
||||
width: A4_WIDTH,
|
||||
height: A4_HEIGHT,
|
||||
scale: newScale,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user