Skip to content

Commit

Permalink
karm-vaev: Corectly apply size to the borderBox instead of the conten…
Browse files Browse the repository at this point in the history
…tBox.
  • Loading branch information
sleepy-monax committed Aug 28, 2024
1 parent 4f75ae2 commit 5d35722
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/web/vaev-layout/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ struct Layout {
InsetsPx padding{};
InsetsPx borders{};
Vec2Px position; //< Position relative to the content box of the containing block
Vec2Px size;
Vec2Px borderSize;
InsetsPx margin{};
RadiiPx radii{};

void repr(Io::Emit &e) const {
e("(layout paddings: {} borders: {} position: {} size: {} margins: {} radii: {})",
padding, borders, position, size, margin, radii);
e("(layout paddings: {} borders: {} position: {} borderSize: {} margin: {} radii: {})",
padding, borders, position, borderSize, margin, radii);
}

Layout offseted(Vec2Px offset) const {
Expand All @@ -74,7 +74,7 @@ struct Layout {
}

RectPx borderBox() const {
return RectPx{position, size}.grow(borders);
return RectPx{position, borderSize};
}

RectPx paddingBox() const {
Expand Down
2 changes: 1 addition & 1 deletion src/web/vaev-layout/frag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Output layout(Tree &t, Frag &f, Input input) {
size = size + padding.all() + borders.all();

if (input.commit == Commit::YES) {
f.layout.size = size;
f.layout.borderSize = size;
f.layout.padding = padding;
f.layout.borders = borders;
f.layout.margin = margin;
Expand Down

0 comments on commit 5d35722

Please sign in to comment.