Seems like a bad idea to use a TRectF as storage for TBound:

Seems like a bad idea to use a TRectF as storage for TBound:
https://quality.embarcadero.com/browse/RSP-13749

This call in TStyledControl.ApplyStyleLookup uses the wrong values for SetBounds:
StyleControl.SetBounds(StyleControl.Margins.Left, StyleControl.Margins.Top,
Width - StyleControl.Margins.Width, Height - StyleControl.Margins.Height);
Margins is of type TBounds and TBounds.Width calls TRectF.Width, which simply returns Right - Left (as we expect from a rectangle). So in the end the expression Width - StyleControl.Margins.Width turns out as Width - StyleControl.Margins.Right + StyleControl.Margins.Left, which makes the width and height parameters in SetBounds larger as they should.
The developer of this code must have assumed that Margins.Width returns the sum of the left and the right margin, which is not the case.
https://quality.embarcadero.com/browse/RSP-13749

Comments

Post a Comment