Canvas size out-of-sync
Original Reporter info from Mantis: xrfang
-
Reporter name: Shannon
Original Reporter info from Mantis: xrfang
- Reporter name: Shannon
Description:
The code to reproduce this problem is:
procedure TForm1.FormPaint(Sender: TObject);
begin
with Canvas do begin
Pen.Width:= 3;
Pen.Color:= clRed;
MoveTo(0, 0);
LineTo(100, 0);
MoveTo(0, 0);
LineTo(0, 100);
MoveTo(Width - 2, Height - 2);
LineTo(Width - 102, Height - 2);
MoveTo(Width - 2, Height - 2);
LineTo(Width - 2, Height - 102);
end;
end;
While the program is running, it draws two "brackets" on the top left and bottom right corner of the form. Now you enlarge the form, the "brackets" is refreshed and awlays shown at the corners. So far so good. But then when you SHRINK the form, only the top-left bracket is show, the bottom-right bracket disappeared.
I think this is because the Width and Height parameter is not processed correctly.
Additional information:
This problem also happens on TPaintBox. And if I set the TPaintBox's align to "Custom" and use 4 anchors, the bottom-right bracket failed to shown completely.
Running on Windows 7 in a VirtualBox.
Mantis conversion info:
- Mantis ID: 22163
- Version: 1.1 (SVN)
- Monitored by: » xrfang (Shannon), » AntonK (Anton Kavalenka)