mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): scaled bbox preview
This commit is contained in:
parent
b88d14b3df
commit
71885db5fd
@ -72,8 +72,8 @@ export class CanvasProgressImage {
|
||||
|
||||
this.isLoading = true;
|
||||
|
||||
const { x, y } = this.manager.stateApi.getBbox().rect;
|
||||
const { dataURL, width, height } = this.lastProgressEvent.progress_image;
|
||||
const { x, y, width, height } = this.manager.stateApi.getBbox().rect;
|
||||
const { dataURL } = this.lastProgressEvent.progress_image;
|
||||
try {
|
||||
this.imageElement = await loadImage(dataURL);
|
||||
if (this.konva.image) {
|
||||
|
@ -43,17 +43,21 @@ export class CanvasStagingArea {
|
||||
|
||||
render = async () => {
|
||||
const session = this.manager.stateApi.getSession();
|
||||
const { rect } = this.manager.stateApi.getBbox();
|
||||
const { x, y, width, height } = this.manager.stateApi.getBbox().rect;
|
||||
const shouldShowStagedImage = this.manager.stateApi.$shouldShowStagedImage.get();
|
||||
|
||||
this.selectedImage = session.stagedImages[session.selectedStagedImageIndex] ?? null;
|
||||
this.konva.group.position({ x: rect.x, y: rect.y });
|
||||
this.konva.group.position({ x, y });
|
||||
|
||||
if (this.selectedImage) {
|
||||
const { imageDTO, offsetX, offsetY } = this.selectedImage;
|
||||
const {
|
||||
imageDTO,
|
||||
// offsetX, // TODO(psyche): restore the crop in the node?
|
||||
// offsetY // TODO(psyche): restore the crop in the node?
|
||||
} = this.selectedImage;
|
||||
|
||||
if (!this.image) {
|
||||
const { image_name, width, height } = imageDTO;
|
||||
const { image_name } = imageDTO;
|
||||
this.image = new CanvasImageRenderer(
|
||||
{
|
||||
id: 'staging-area-image',
|
||||
|
Loading…
Reference in New Issue
Block a user