mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): max scale 1 when reset view
This commit is contained in:
parent
d74843be31
commit
34b57ec188
@ -315,7 +315,7 @@ export class CanvasManager {
|
||||
const availableWidth = width - padding * 2;
|
||||
const availableHeight = height - padding * 2;
|
||||
|
||||
const scale = Math.min(availableWidth / rect.width, availableHeight / rect.height);
|
||||
const scale = Math.min(Math.min(availableWidth / rect.width, availableHeight / rect.height), 1);
|
||||
const x = -rect.x * scale + padding + (availableWidth - rect.width * scale) / 2;
|
||||
const y = -rect.y * scale + padding + (availableHeight - rect.height * scale) / 2;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user