Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/core/text-rendering/TextLayoutEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,9 @@ export const wrapLine = (
continue;
}
const space = spaces[spaceIdx++] || '';
// For width calculation, treat ZWSP as having 0 width but regular space functionality
const effectiveSpaceWidth = space === '\u200B' ? 0 : spaceWidth;
// Measure the real separator \u2014 multi-space runs collapse into one match.
const effectiveSpaceWidth =
space.length > 0 ? measureText(space, fontFamily, letterSpacing) : 0;
const totalWidth = currentLineWidth + effectiveSpaceWidth + wordWidth;

if (totalWidth < maxWidth) {
Expand Down
Loading