Skip to content

Commit 568e89e

Browse files
author
Abdallah Mohammed
authored
Fix Image with short height and long width and vice versa (#616)
* Fix Image with short width or height * Lint fixes * Remove some code * Fix problems related to image * Update Size.vala
1 parent 2cb61ce commit 568e89e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Lib/Components/Size.vala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public class Akira.Lib.Components.Size : Component {
4141

4242
if (locked && !auto_resize) {
4343
auto_resize = true;
44-
height = Utils.AffineTransform.fix_size (value / ratio);
44+
var locked_height = Utils.AffineTransform.fix_size (value / ratio);
45+
height = item is Items.CanvasImage && locked_height < 1 ? 1 : locked_height;
4546
auto_resize = false;
4647
}
4748

@@ -70,7 +71,8 @@ public class Akira.Lib.Components.Size : Component {
7071

7172
if (locked && !auto_resize) {
7273
auto_resize = true;
73-
width = Utils.AffineTransform.fix_size (value * ratio);
74+
var locked_width = Utils.AffineTransform.fix_size (value / ratio);
75+
height = item is Items.CanvasImage && locked_width < 1 ? 1 : locked_width;
7476
auto_resize = false;
7577
}
7678

0 commit comments

Comments
 (0)