Skip to content

Commit

Permalink
fix: removed relative-column class from rectangle (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
maharshivpatel authored Jun 26, 2024
2 parents c236179 + 4895551 commit f8c32de
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export const useElementStore = defineStore("ElementStore", {
if (el.type == "rectangle") {
el.childrens = this.computeRowLayout(el.childrens, el);
el.layoutType = "column";
el.classes.push("relative-column");
el.classes = el.classes.filter((c) => c != "relative-column");
el.rectangleContainer = true;
if (el.childrens.some((e) => e.heightType == "auto-min-height")) {
el.heightType = "auto-min-height";
Expand Down Expand Up @@ -780,13 +780,15 @@ export const useElementStore = defineStore("ElementStore", {
if (wrapper.layoutType == "column") {
wrapper.width = dimensions.right - dimensions.left;
wrapper.height = parent.height || 0;
wrapper.classes = wrapper.classes.filter((c) => c != "relative-column");
wrapper.classes.push("relative-column");
wrapper.relativeColumn = true;
} else {
wrapper.width =
parent.width ||
MainStore.page.width - MainStore.page.marginLeft - MainStore.page.marginRight;
wrapper.height = dimensions.bottom - dimensions.top;
wrapper.classes = wrapper.classes.filter((c) => c != "relative-row");
wrapper.classes.push("relative-row");
wrapper.classes.push(wrapper.id);
}
Expand Down Expand Up @@ -880,6 +882,7 @@ export const useElementStore = defineStore("ElementStore", {
parent.width ||
MainStore.page.width - MainStore.page.marginLeft - MainStore.page.marginRight;
wrapper.height = dimension.bottom - dimension.top;
wrapper.classes = wrapper.classes.filter((c) => c != "relative-row");
wrapper.classes.push("relative-row");
delete wrapper.parent;
this.updateRowElement(wrapper, currentRow, parent);
Expand Down Expand Up @@ -927,6 +930,7 @@ export const useElementStore = defineStore("ElementStore", {
wrapper.layoutType = "column";
wrapper.width = dimension.right - dimension.left;
wrapper.height = parent.height;
wrapper.classes = wrapper.classes.filter((c) => c != "relative-column");
wrapper.classes.push("relative-column");
wrapper.relativeColumn = true;
delete wrapper.parent;
Expand Down

0 comments on commit f8c32de

Please sign in to comment.