Skip to content

Commit

Permalink
Landscape and Portrait layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
viliusle committed Jun 19, 2021
1 parent 0fa15bd commit 1c35680
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/js/modules/file/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class File_new_class {
{name: "width", title: "Width:", value: width, comment: units},
{name: "height", title: "Height:", value: height, comment: units},
{name: "resolution_type", title: "Resolution:", values: resolution_types},
{name: "layout", title: "Layout:", value: "Custom", values: ["Custom", "Landscape", "Portrait"]},
{name: "transparency", title: "Transparent:", value: transparency},
],
on_finish: function (params) {
Expand All @@ -79,6 +80,12 @@ class File_new_class {
dim = dim[0].split("x");
width = parseInt(dim[0]);
height = parseInt(dim[1]);

if(response.layout == 'Portrait'){
var tmp = width;
width = height;
height = tmp;
}
}
else {
//convert units
Expand Down
7 changes: 7 additions & 0 deletions src/js/modules/image/size.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Image_size_class {
{name: "w", title: "Width:", value: width, placeholder: width, comment: units},
{name: "h", title: "Height:", value: height, placeholder: height, comment: units},
{name: "resolution", title: "Resolution:", values: resolutions},
{name: "layout", title: "Layout:", value: "Custom", values: ["Custom", "Landscape", "Portrait"]},
],
on_finish: function (params) {
_this.size_handler(params);
Expand Down Expand Up @@ -76,6 +77,12 @@ class Image_size_class {
dim = dim[0].split("x");
width = parseInt(dim[0]);
height = parseInt(dim[1]);

if(data.layout == 'Portrait'){
var tmp = width;
width = height;
height = tmp;
}
}
else{
//convert units
Expand Down

0 comments on commit 1c35680

Please sign in to comment.