fix: use LOGICAL_WIDTH,HEIGHT instead of SCREEN_WIDTH,HEIGHT beucase screen is scaled
This commit is contained in:
@@ -8,13 +8,13 @@ const confirmationModal = useConfirmationModal();
|
||||
|
||||
const BG_WIDTH = assets.images.common.confirmationModal.rect.width;
|
||||
const BG_HEIGHT = assets.images.common.confirmationModal.rect.height;
|
||||
const BG_X = Math.floor((SCREEN_WIDTH - BG_WIDTH) / 2);
|
||||
const BG_Y = Math.floor((SCREEN_HEIGHT - BG_HEIGHT) / 2);
|
||||
const BG_X = Math.floor((LOGICAL_WIDTH - BG_WIDTH) / 2);
|
||||
const BG_Y = Math.floor((LOGICAL_HEIGHT - BG_HEIGHT) / 2);
|
||||
|
||||
const TEXT_Y = BG_Y + Math.floor(BG_HEIGHT / 2) - 8 - 16 + 2 + 2;
|
||||
|
||||
const BOTTOM_BAR_HEIGHT = 24;
|
||||
const CLIP_HEIGHT = SCREEN_HEIGHT - BOTTOM_BAR_HEIGHT;
|
||||
const CLIP_HEIGHT = LOGICAL_HEIGHT - BOTTOM_BAR_HEIGHT;
|
||||
|
||||
const handleActivateA = () => {
|
||||
confirmationModal.onConfirm?.();
|
||||
@@ -29,7 +29,7 @@ onRender((ctx) => {
|
||||
if (!confirmationModal.isVisible) return;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.rect(0, 0, SCREEN_WIDTH, CLIP_HEIGHT);
|
||||
ctx.rect(0, 0, LOGICAL_WIDTH, CLIP_HEIGHT);
|
||||
ctx.clip();
|
||||
|
||||
ctx.translate(0, confirmationModal.offsetY);
|
||||
|
||||
Reference in New Issue
Block a user