mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): jank when starting a shape when not already focused on stage
This commit is contained in:
parent
1fa8032fdb
commit
c171fe2b96
@ -1,6 +1,5 @@
|
|||||||
import { calculateNewBrushSize } from 'features/canvas/hooks/useCanvasZoom';
|
import { calculateNewBrushSize } from 'features/canvas/hooks/useCanvasZoom';
|
||||||
import {
|
import {
|
||||||
getIsFocused,
|
|
||||||
getIsMouseDown,
|
getIsMouseDown,
|
||||||
getScaledFlooredCursorPosition,
|
getScaledFlooredCursorPosition,
|
||||||
snapPosToStage,
|
snapPosToStage,
|
||||||
@ -205,7 +204,8 @@ export const setStageEventHandlers = ({
|
|||||||
if (selectedLayer.type !== 'regional_guidance_layer' && selectedLayer.type !== 'raster_layer') {
|
if (selectedLayer.type !== 'regional_guidance_layer' && selectedLayer.type !== 'raster_layer') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!getIsFocused(stage) || !getIsMouseDown(e)) {
|
|
||||||
|
if (!getIsMouseDown(e)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ export const setStageEventHandlers = ({
|
|||||||
if (selectedLayer.type !== 'regional_guidance_layer' && selectedLayer.type !== 'raster_layer') {
|
if (selectedLayer.type !== 'regional_guidance_layer' && selectedLayer.type !== 'raster_layer') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (getIsFocused(stage) && getIsMouseDown(e)) {
|
if (getIsMouseDown(e)) {
|
||||||
if (tool === 'brush') {
|
if (tool === 'brush') {
|
||||||
onPointAddedToLine({ layerId: selectedLayer.id, point: [pos.x, pos.y] });
|
onPointAddedToLine({ layerId: selectedLayer.id, point: [pos.x, pos.y] });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user