feat: centralize all screen related callbacks in useScreen
This commit is contained in:
@@ -9,6 +9,8 @@ const props = withDefaults(
|
||||
},
|
||||
);
|
||||
|
||||
const { onRender } = useScreen();
|
||||
|
||||
const app = useAppStore();
|
||||
const { assets } = useAssets();
|
||||
|
||||
@@ -17,7 +19,7 @@ const CORNER_SIZE = 11;
|
||||
|
||||
let [currentX, currentY, currentWidth, currentHeight] = props.rect;
|
||||
|
||||
useRender((ctx) => {
|
||||
onRender((ctx) => {
|
||||
const [targetX, targetY, targetWidth, targetHeight] = props.rect;
|
||||
const dx = targetX - currentX;
|
||||
const dy = targetY - currentY;
|
||||
|
||||
Reference in New Issue
Block a user