Skip to content

Commit 8c4efbf

Browse files
committed
Keep aspect ratio
1 parent c5fd13b commit 8c4efbf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

electron_app/src/components/Outpainting.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,19 @@ export default {
342342
imgg.setAttrs({
343343
x: that.box.x(),
344344
y: that.box.y(),
345-
width: that.box.width(),
346-
height: that.box.height(),
345+
scaleX: scale,
346+
scaleY: scale,
347347
});
348+
349+
350+
if (imgg.width() == imgg.height()){
351+
imgg.setAttrs({
352+
width: that.box.width(),
353+
height: that.box.height(),
354+
});
355+
}
356+
357+
348358
that.images_layer.add(imgg);
349359
350360
let box = new Konva.Rect({

0 commit comments

Comments
 (0)