mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): hold shift w/ brush to draw straight line
This commit is contained in:
parent
091e2fb751
commit
f083be9391
@ -187,6 +187,17 @@ export const setStageEventHandlers = ({
|
|||||||
setLastMouseDownPos(pos);
|
setLastMouseDownPos(pos);
|
||||||
|
|
||||||
if (toolState.selected === 'brush') {
|
if (toolState.selected === 'brush') {
|
||||||
|
if (e.evt.shiftKey) {
|
||||||
|
// Extend the last line straight to the new point
|
||||||
|
setLastAddedPoint(pos);
|
||||||
|
onPointAddedToLine(
|
||||||
|
{
|
||||||
|
id: selectedEntity.id,
|
||||||
|
point: [pos.x - selectedEntity.x, pos.y - selectedEntity.y],
|
||||||
|
},
|
||||||
|
selectedEntity.type
|
||||||
|
);
|
||||||
|
} else {
|
||||||
onBrushLineAdded(
|
onBrushLineAdded(
|
||||||
{
|
{
|
||||||
id: selectedEntity.id,
|
id: selectedEntity.id,
|
||||||
@ -202,8 +213,20 @@ export const setStageEventHandlers = ({
|
|||||||
selectedEntity.type
|
selectedEntity.type
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (toolState.selected === 'eraser') {
|
if (toolState.selected === 'eraser') {
|
||||||
|
if (e.evt.shiftKey) {
|
||||||
|
// Extend the last line straight to the new point
|
||||||
|
setLastAddedPoint(pos);
|
||||||
|
onPointAddedToLine(
|
||||||
|
{
|
||||||
|
id: selectedEntity.id,
|
||||||
|
point: [pos.x - selectedEntity.x, pos.y - selectedEntity.y],
|
||||||
|
},
|
||||||
|
selectedEntity.type
|
||||||
|
);
|
||||||
|
} else {
|
||||||
onEraserLineAdded(
|
onEraserLineAdded(
|
||||||
{
|
{
|
||||||
id: selectedEntity.id,
|
id: selectedEntity.id,
|
||||||
@ -218,6 +241,7 @@ export const setStageEventHandlers = ({
|
|||||||
selectedEntity.type
|
selectedEntity.type
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//#region mouseup
|
//#region mouseup
|
||||||
|
Loading…
Reference in New Issue
Block a user