Skip to content

Commit b4e0137

Browse files
committed
Fix html text layout but adding 1.
1 parent 7c4a494 commit b4e0137

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fidget/htmlbackend.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ proc computeTextBox*(
8787

8888
tempDiv.innerText = text
8989

90-
result.x = float tempDiv.clientWidth
91-
result.y = float tempDiv.clientHeight
90+
result.x = float(tempDiv.clientWidth) + 1.0
91+
result.y = float(tempDiv.clientHeight)
9292
computeTextBoxCache[key] = result
9393

9494
computeTextLayout = proc(node: Node) =
@@ -124,7 +124,7 @@ proc measureText(
124124
): TextMetrics {.importcpp.}
125125

126126
var baseLineCache = newTable[string, float]()
127-
proc getBaseLine *(
127+
proc getBaseLine*(
128128
fontName: string,
129129
fontSize: float,
130130
fontWeight: float,

0 commit comments

Comments
 (0)