feat(inline): rendering without alternate screen
Fix issue with growth resize for containers with corresponding borders, padding and gaps.
This commit was merged in pull request #2.
This commit is contained in:
@@ -764,23 +764,31 @@ pub fn Container(Model: type, Event: type) type {
|
||||
|
||||
const sides = this.properties.border.sides;
|
||||
switch (layout.direction) {
|
||||
.horizontal => {
|
||||
.vertical => {
|
||||
if (sides.top) {
|
||||
available -|= 1;
|
||||
remainder -|= 1;
|
||||
}
|
||||
if (sides.bottom) {
|
||||
available -|= 1;
|
||||
remainder -|= 1;
|
||||
}
|
||||
},
|
||||
.vertical => {
|
||||
if (sides.left) {
|
||||
available -|= 1;
|
||||
remainder -|= 1;
|
||||
}
|
||||
if (sides.right) {
|
||||
available -|= 1;
|
||||
}
|
||||
},
|
||||
.horizontal => {
|
||||
if (sides.top) {
|
||||
available -|= 1;
|
||||
}
|
||||
if (sides.bottom) {
|
||||
available -|= 1;
|
||||
}
|
||||
if (sides.left) {
|
||||
remainder -|= 1;
|
||||
}
|
||||
if (sides.right) {
|
||||
remainder -|= 1;
|
||||
}
|
||||
},
|
||||
@@ -815,7 +823,7 @@ pub fn Container(Model: type, Event: type) type {
|
||||
.horizontal => if (child.properties.size.grow == .vertical or child.properties.size.grow == .vertical_only or child.properties.size.grow == .both) {
|
||||
child.size.y = available;
|
||||
},
|
||||
.vertical => if (child.properties.size.grow == .horizontal or child.properties.size.grow == .vertical_only or child.properties.size.grow == .both) {
|
||||
.vertical => if (child.properties.size.grow == .horizontal or child.properties.size.grow == .horizontal_only or child.properties.size.grow == .both) {
|
||||
child.size.x = available;
|
||||
},
|
||||
}
|
||||
@@ -862,23 +870,23 @@ pub fn Container(Model: type, Event: type) type {
|
||||
};
|
||||
if (child.properties.size.grow != .fixed and child_size == smallest_size) {
|
||||
switch (layout.direction) {
|
||||
.horizontal => if (child.properties.size.grow != .vertical) {
|
||||
.horizontal => if (child.properties.size.grow != .vertical and child.properties.size.grow != .vertical_only) {
|
||||
child.size.x += size_to_correct;
|
||||
remainder -|= size_to_correct;
|
||||
},
|
||||
.vertical => if (child.properties.size.grow != .horizontal) {
|
||||
.vertical => if (child.properties.size.grow != .horizontal and child.properties.size.grow != .horizontal_only) {
|
||||
child.size.y += size_to_correct;
|
||||
remainder -|= size_to_correct;
|
||||
},
|
||||
}
|
||||
if (overflow > 0) {
|
||||
switch (layout.direction) {
|
||||
.horizontal => if (child.properties.size.grow != .vertical) {
|
||||
.horizontal => if (child.properties.size.grow != .vertical and child.properties.size.grow != .vertical_only) {
|
||||
child.size.x += 1;
|
||||
overflow -|= 1;
|
||||
remainder -|= 1;
|
||||
},
|
||||
.vertical => if (child.properties.size.grow != .horizontal) {
|
||||
.vertical => if (child.properties.size.grow != .horizontal and child.properties.size.grow != .horizontal_only) {
|
||||
child.size.y += 1;
|
||||
overflow -|= 1;
|
||||
remainder -|= 1;
|
||||
|
||||
Reference in New Issue
Block a user