View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0038328||Lazarus||LCL||public||2021-01-07 19:51||2021-01-09 22:10|
|Product Version||2.1 (SVN)|
|Summary||0038328: Qt5 TLabel in vertical rotation, text gets clipped on resize in the designer|
|Description||When you set the Font of the TLabel in vertical rotation (900 or 2600 rotation value) and then try to resize the rectangle of the label in Designer, the text (caption) gets clipped. I've made a little movie on youtube where you can see the behavior.|
The compiled form will show just the first two letters of the text/caption in Qt5 case, and if you use the gtk2 widget set, the label text will not be shown at all.
|Steps To Reproduce||1. Select the TLabel and place it in the form;|
2. Set the Autosize attribute to False;
3. Re-dimension the label's frame to form a square to see where the text goes when you rotate it;
4. Set the rotation of the font to 900 or 2600 - now the text goes to a vertical position;
5. Align it Top or Bottom (BTW, only Top works correctly);
6. Now, because our frame is in a square form, try to resize it to enclose the label. You will see that approaching the text, it will get clipped by "an invisible rectangle - you really have to see the video, the animation there is funny".
|Tags||No tags attached.|
|Fixed in Revision||64361|
||Not only QT5, all widgetsets. The rectangle in which the text is enclosed does not follow the rotation of the text.|
Here is a demo which shows that clipping is an issue, too.
- Run the demo
- Turn off AutoSize, set Alignment to taCenter and Layout to tlCenter
- Slightly shift the scrollbar to the right in order to rotate the label. Although the label bounds are "far" away the text is clipped approximately at the bounds of the autosized label. riginal
When I add DT_NOCLIP to the flags passed to the DrawText call at the end of TCustomLabel.DoDrawText (in customlabel.inc) the clipping goes away.
However, there is still the issue that during rotation the bounds of the AutoSized label do not change such that the label text is always enclosed.
38328 - RotatedLabels.zip (2,250 bytes)
||Confirmed an issue with Cocoa widgetset in Lazarus 2.1.0. Rotating the text of the label causes the label text to disappear. Increasing the angle degree by degree heading to 900 (90 degrees), the text moves in the right direction but out of bounds at the top until it is no longer visible within the label bounds at all.|
||This is a regression caused by r64173, "TCustomLabel: DoDrawText for Delphi compatibility and for unifying size calculation and painting" by Ondrej.|
Supports rotation about any angle now. No support yet for multiline text (Delphi XE10.3 does not have this either).
Please test and close if ok.
||Confirmed fixed in Cocoa widgetset|
|2021-01-07 19:51||funlw65||New Issue|
|2021-01-07 19:56||wp||Note Added: 0128151|
|2021-01-07 20:15||wp||Note Added: 0128152|
|2021-01-07 20:15||wp||File Added: 38328 - RotatedLabels.zip|
|2021-01-07 22:44||Trevor Roydhouse||Note Added: 0128158|
|2021-01-07 22:49||wp||Assigned To||=> Ondrej Pokorny|
|2021-01-07 22:49||wp||Status||new => assigned|
|2021-01-07 22:53||wp||Note Added: 0128159|
|2021-01-09 13:13||wp||Assigned To||Ondrej Pokorny => wp|
|2021-01-09 13:14||wp||Status||assigned => resolved|
|2021-01-09 13:14||wp||Resolution||open => fixed|
|2021-01-09 13:14||wp||Fixed in Revision||=> 64361|
|2021-01-09 13:14||wp||LazTarget||=> -|
|2021-01-09 13:14||wp||Widgetset||QT5 => QT5|
|2021-01-09 13:14||wp||Note Added: 0128196|
|2021-01-09 22:09||Trevor Roydhouse||Note Added: 0128222|