mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): only update stage attrs when stage itself is dragged
This commit is contained in:
parent
465f020c86
commit
6db615ed5a
@ -522,7 +522,10 @@ export const setStageEventHandlers = (manager: CanvasManager): (() => void) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//#region dragmove
|
//#region dragmove
|
||||||
stage.on('dragmove', () => {
|
stage.on('dragmove', (e) => {
|
||||||
|
if (e.target !== stage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$stageAttrs.set({
|
$stageAttrs.set({
|
||||||
x: Math.floor(stage.x()),
|
x: Math.floor(stage.x()),
|
||||||
y: Math.floor(stage.y()),
|
y: Math.floor(stage.y()),
|
||||||
@ -533,8 +536,10 @@ export const setStageEventHandlers = (manager: CanvasManager): (() => void) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//#region dragend
|
//#region dragend
|
||||||
stage.on('dragend', () => {
|
stage.on('dragend', (e) => {
|
||||||
// Stage position should always be an integer, else we get fractional pixels which are blurry
|
if (e.target !== stage) {
|
||||||
|
return;
|
||||||
|
} // Stage position should always be an integer, else we get fractional pixels which are blurry
|
||||||
$stageAttrs.set({
|
$stageAttrs.set({
|
||||||
x: Math.floor(stage.x()),
|
x: Math.floor(stage.x()),
|
||||||
y: Math.floor(stage.y()),
|
y: Math.floor(stage.y()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user