File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
invokeai/frontend/web/src/features/controlLayers/konva/CanvasTool Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -344,9 +344,9 @@ export class CanvasBboxToolModule extends CanvasModuleBase {
344
344
let width = roundToMultipleMin ( this . konva . proxyRect . width ( ) * this . konva . proxyRect . scaleX ( ) , gridSize ) ;
345
345
let height = roundToMultipleMin ( this . konva . proxyRect . height ( ) * this . konva . proxyRect . scaleY ( ) , gridSize ) ;
346
346
347
- // If shift is held and we are resizing from a corner, retain aspect ratio - needs special handling. We skip this
348
- // if alt/opt is held - this requires math too big for my brain.
349
- if ( shift && CORNER_ANCHORS . includes ( anchor ) && ! alt ) {
347
+ // If ratio is locked OR shift is held and we are resizing from a corner, retain aspect ratio - needs special
348
+ // handling. We skip this if alt/opt is held - this requires math too big for my brain.
349
+ if ( ( this . manager . stateApi . getBbox ( ) . aspectRatio . isLocked || ( shift && CORNER_ANCHORS . includes ( anchor ) ) ) && ! alt ) {
350
350
// Fit the bbox to the last aspect ratio
351
351
let fittedWidth = Math . sqrt ( width * height * this . $aspectRatioBuffer . get ( ) ) ;
352
352
let fittedHeight = fittedWidth / this . $aspectRatioBuffer . get ( ) ;
You can’t perform that action at this time.
0 commit comments