2
2
3
3
#include < karm-text/prose.h>
4
4
#include < vaev-values/display.h>
5
+ #include < vaev-values/insets.h>
5
6
#include < vaev-values/keywords.h>
6
7
7
8
export module Vaev.Layout:inline_;
@@ -72,9 +73,11 @@ struct InlineFormatingContext : FormatingContext {
72
73
}
73
74
);
74
75
75
- boxStrutCell.size = atomicBoxOutput.size ;
76
- // FIXME: hard-coding alphabetic alignment, missing alignment-baseline and dominant-baseline
77
- boxStrutCell.baseline = getUsedBaselineFromBox (atomicBox, atomicBoxOutput).alphabetic ;
76
+ if (atomicBox.style ->position != Position::ABSOLUTE) {
77
+ boxStrutCell.size = atomicBoxOutput.size ;
78
+ // FIXME: hard-coding alphabetic alignment, missing alignment-baseline and dominant-baseline
79
+ boxStrutCell.baseline = getUsedBaselineFromBox (atomicBox, atomicBoxOutput).alphabetic ;
80
+ }
78
81
}
79
82
80
83
// FIXME: prose has a ongoing state that is not reset between layout calls, but it should be
@@ -89,19 +92,27 @@ struct InlineFormatingContext : FormatingContext {
89
92
auto positionInProse = prose->queryPosition (runeIdx);
90
93
91
94
auto & boxStrutCell = *strutCell->strut ();
95
+ auto & atomicBox = *inlineBox.atomicBoxes [boxStrutCell.id ];
92
96
93
- Math::Vec2<Opt<Au>> knownSize = {
94
- boxStrutCell.size .x ,
95
- boxStrutCell.size .y
96
- };
97
+ Math::Vec2<Opt<Au>> knownSize;
98
+ if (atomicBox.style ->position != Position::ABSOLUTE) {
99
+ knownSize = {
100
+ boxStrutCell.size .x ,
101
+ boxStrutCell.size .y
102
+ };
103
+ }
97
104
98
105
layout (
99
106
tree,
100
- inlineBox. atomicBoxes [boxStrutCell. id ] ,
107
+ atomicBox ,
101
108
Input{
102
109
.fragment = input.fragment ,
103
110
.knownSize = knownSize,
104
111
.position = input.position + positionInProse,
112
+ .containingBlock = {
113
+ input.knownSize .x .unwrapOr (0_au),
114
+ input.knownSize .y .unwrapOr (0_au)
115
+ },
105
116
}
106
117
);
107
118
}
0 commit comments