Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2007-07

qtwinapi DrawText regression ?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

zeljko

Hi,

There's a qtwinapi patch (r11520) which assigns Rect before exiting proc, now all texts in eg. TStringGrid cells, DrawText() via Canvas are bottom aligned, not centered. Is this normal or just Rect := R shouldn't be there ?

zeljko

Paul Ishenin
to zeljko
zeljko wrote 6 lines
Hi, There's a qtwinapi patch (r11520) which assigns Rect before exiting proc, now all texts in eg. TStringGrid cells, DrawText() via Canvas are bottom aligned, not centered. Is this normal or just Rect := R shouldn't be there ?

When DT_CALCRECT is used Rect should return rectangle that Text will occupy. I assumpted that Layout and Alignment flags should be taked into account while calculating rectangle, but no - only width and height must be added to original left and top.

So, I changed a bit code and now it works fine.

Best regards,
Paul Ishenin.

zeljko
to Paul Ishenin
Paul Ishenin wrote 14 lines
zeljko wrote: > Hi, > > There's a qtwinapi patch (r11520) which assigns Rect before exiting proc, > now all texts in eg. TStringGrid cells, DrawText() via Canvas are bottom > aligned, not centered. Is this normal or just Rect := R shouldn't be > there ? When DT_CALCRECT is used Rect should return rectangle that Text will occupy. I assumpted that Layout and Alignment flags should be taked into account while calculating rectangle, but no - only width and height must be added to original left and top. So, I changed a bit code and now it works fine.

tnx