mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): floor canvas coords to prevent partial pixel offset rendering issues
This commit is contained in:
parent
e1e5266fc3
commit
835922ea8f
@ -9,8 +9,12 @@ const calculateCoordinates = (
|
|||||||
contentHeight: number,
|
contentHeight: number,
|
||||||
scale: number
|
scale: number
|
||||||
): Vector2d => {
|
): Vector2d => {
|
||||||
const x = containerWidth / 2 - (containerX + contentWidth / 2) * scale;
|
const x = Math.floor(
|
||||||
const y = containerHeight / 2 - (containerY + contentHeight / 2) * scale;
|
containerWidth / 2 - (containerX + contentWidth / 2) * scale
|
||||||
|
);
|
||||||
|
const y = Math.floor(
|
||||||
|
containerHeight / 2 - (containerY + contentHeight / 2) * scale
|
||||||
|
);
|
||||||
return { x, y };
|
return { x, y };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user