Home » U++ Library support » RichText,QTF,RTF... » Potential QTF minor bug or misunderstanding
Potential QTF minor bug or misunderstanding [message #51592] |
Thu, 18 April 2019 15:35  |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
Using a RichTextCtrl with Margins and a very specific qtf causes the size calculations to ignore a word that is moved from one line to the other.
Application attached. Press the button.
Here is the interesting bit.
The QTF ends in "}}]". This causes the problem.
Using "}}\n]" still has the problem.
Using a space, "}} ]" works.
Is this a bug or did I misunderstand spacing rules in QTF?
Edit: adding the space, "}} ]" causes other qtfs that displayed properly before to be larger.
This can be reproduced by deleting "descending" from the qtf.
-
Attachment: testqtf.zip
(Size: 1.44KB, Downloaded 237 times)
[Updated on: Thu, 18 April 2019 15:42] Report message to a moderator
|
|
|
|
Re: Potential QTF minor bug or misunderstanding [message #51594 is a reply to message #51593] |
Thu, 18 April 2019 15:52   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
Added cleaner example, without some wrong and redundant calculations (yey, found an ancient bug).
And screenshot. The larger you make the margin, the worse it gets: more is cut off.
I have 150% zoom on my desktop, but I'm also using some hacks to turn Win10 zoom into Win8 zoom. That's why screenshots are blurry.
The key to the issue is having the line of text break in two I believe, so that might work without changing zoom.
Edit: the new cleaner example no longer depends on the use of space in QTF, looks like a margin issue.
-
Attachment: qtf.png
(Size: 9.18KB, Downloaded 347 times)
-
Attachment: testqtf.zip
(Size: 1.38KB, Downloaded 236 times)
[Updated on: Thu, 18 April 2019 15:55] Report message to a moderator
|
|
|
Re: Potential QTF minor bug or misunderstanding [message #51644 is a reply to message #51594] |
Tue, 23 April 2019 09:28   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
I added Ctrl::NoLayoutZoom() in main but still doesn't help.
It looks to be a margin issue, combined with the hidden scroll bar. If I enable scrollbar, the size is good. But it is my expectation that for at least small popups, margin should add on to the calculated size in both dimensions. Is it a wrong expectation?
The issue still looks like it only happens when the last word in the qtf, "indices" doesn't fit on the last line and is moved to a new line due to left justified text.
-
Attachment: qtf2.png
(Size: 17.15KB, Downloaded 431 times)
[Updated on: Tue, 23 April 2019 09:32] Report message to a moderator
|
|
|
|
Re: Potential QTF minor bug or misunderstanding [message #51726 is a reply to message #51693] |
Fri, 03 May 2019 10:52  |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
mirek wrote on Fri, 26 April 2019 12:04Well, Margin is not accounted for in GetHeight, that is the root of problems.
I guess for your particular case, the metrics methods are sort of missing. However, if you look into ide AssistEditor::SyncAnnotationPopup() there is complete solution, you just need to account for margins...
Mirek
Thanks! For now I added (Zx(margin) + 1) * 2 to both height and width. Probably not perfect but improved.
|
|
|
Goto Forum:
Current Time: Fri May 09 12:14:03 CEST 2025
Total time taken to generate the page: 0.00965 seconds
|