diff options
author | bptato <nincsnevem662@gmail.com> | 2021-11-23 14:08:37 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-11-23 14:08:37 +0100 |
commit | a413a3115f242395ef1149c263d3280e62f1608e (patch) | |
tree | 84d3d0e813f5695711a3e29dec3f74f9ddb6df52 | |
parent | fbac38a0b0ce15954f8ba441a7a1adfb67dd8a80 (diff) | |
download | chawan-a413a3115f242395ef1149c263d3280e62f1608e.tar.gz |
Add margin to p, fix inline wrapping
-rw-r--r-- | res/default.css | 5 | ||||
-rw-r--r-- | src/layout/engine.nim | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/res/default.css b/res/default.css index fe0e99d7..56691cbb 100644 --- a/res/default.css +++ b/res/default.css @@ -53,6 +53,11 @@ pre { white-space: pre; } +p { + margin-top: 1em; + margin-bottom: 1em; +} + a { color: yellow; } diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 6ca232b7..0fbaf882 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -116,7 +116,7 @@ proc processInlineBox(parent: CSSBox, str: string): CSSBox = ibox.context.whitespace = false fastRuneAt(str, i, r) rw = r.width() - if rowbox.width + r.width() > ibox.width: + if fromx + rowbox.width + r.width() > ibox.width: inlineWrap(ibox, rowi, fromx, rowbox) rowbox.width += rw |