#15393 closed defect (fixed)

A wxRichTextTable with percentage width is wrongly laid out

Reported by: dghart Owned by:
Priority: normal Milestone: 3.0.0
Component: wxRichText Version: stable-latest
Keywords: wxRichTextTable wxTEXT_ATTR_UNITS_PERCENTAGE Cc:
Blocked By: Blocking:
Patch: yes

Description

wxRichTextTable can optionally be given a width, either in pixels or as a percentage of the available width. If the latter it becomes too narrow, as can be seen in the before/after screenshots and richtext.diff.

The problem is that the available-width passed to wxRichTextTable::Layout already takes the percentage reduction into account; then the percentage is applied again to the width available for the contained cells, resulting in cells that are too narrow for the table; and finally the table width is shrunk to fit the contents. The solution, in richtextbuffer.diff, is not to reduce the width available to the cells when the table has percentage width.

Attachments (4)

richtextbuffer.diff download (1010 bytes) - added by dghart 12 months ago.
sample.diff download (12.3 KB) - added by dghart 12 months ago.
TablesPercentBeforePatch.png download (32.1 KB) - added by dghart 12 months ago.
TablesPercentWithPatch.png download (36.1 KB) - added by dghart 12 months ago.

Download all attachments as: .zip

Change History (5)

Changed 12 months ago by dghart

Changed 12 months ago by dghart

Changed 12 months ago by dghart

Changed 12 months ago by dghart

comment:1 Changed 12 months ago by juliansmart

  • Resolution set to fixed
  • Status changed from new to closed

Applied, many thanks.

Note: See TracTickets for help on using tickets.