Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c660564 to
5374c86
Compare
moduleI did this about nine months ago. I never finished it; CPP is very difficult. They are all in .cpp. I'm bad at .cpp I don't know how to diagnose freeze and fix in vs community 2022. |
5374c86 to
85f8ac2
Compare
0fd07ee to
895d9e0
Compare
fix(html): block elements now fill parent width for correct text wrapping and centering Auto-width block elements (display:block/list-item) now get AnchorLeft+AnchorRight, matching standard CSS block layout. This ensures <p> widgets inside <center>/<td> span the full container width, allowing wrapText to wrap at the correct boundary and calculateGlyphsPositions to independently center each wrapped line. Also tightens centerTagCenter detection to require an explicitly-set pixel width (valueCalculed > -1) so unsized blocks are never mistaken for centered fixed-width elements.
fix(html): block elements now fill parent width for correct text wrapping and centering Auto-width block elements (display:block/list-item) now get AnchorLeft+AnchorRight, matching standard CSS block layout. This ensures <p> widgets inside <center>/<td> span the full container width, allowing wrapText to wrap at the correct boundary and calculateGlyphsPositions to independently center each wrapped line. Also tightens centerTagCenter detection to require an explicitly-set pixel width (valueCalculed > -1) so unsized blocks are never mistaken for centered fixed-width elements.
fix(html): fix text wrapping and center alignment in HTML renderer
- html.css: add `center { display: block; text-align: center }` so <center> elements behave as block containers and horizontally center their children, consistent with browser behaviour.
- uiwidgettext.cpp (updateText): change wrap guard from `m_rect.isValid()` to `m_rect.width() > 0` so text wrapping is applied on the first layout pass even when the widget height has not yet been resolved (height == 0).
- uiwidgethtml.cpp (applyBlock): auto-width block and list-item elements now receive AnchorLeft + AnchorRight anchors to their parent, making them fill the containing block width. Previously only AnchorLeft was set, leaving the
right edge unconstrained.
- uiwidgethtml.cpp (applyFitContentRecursive): skip calling setWidth_px on width:auto block/list-item elements. These elements must derive their width from the containing block (via updateDimension in the layout batch), not from their content. The previous behaviour would traverse text nodes with a parent width of 0, measure their natural unwrapped width, stamp that value (e.g. 854 px) back onto the paragraph and clear pendingUpdate, causing the subsequent updateDimension call to skip the element and leave it wider than its container. Fix preserves the content-width contribution to ancestor fit-content containers.
Include img, audio, video, canvas, embed and object to have space on left/right by default.
35c1b7a to
b492cb8
Compare




Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Behavior
Actual
Do this and that doesn't happens
Expected
Do this and that happens
Fixes
# (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist