View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0021806||Lazarus||LCL||public||2012-04-19 16:48||2012-04-20 01:12|
|Reporter||Alexander S. Klenin||Assigned To||Paul Ishenin|
|Status||resolved||Resolution||no change required|
|Product Version||1.1 (SVN)|
|Fixed in Version||1.1 (SVN)|
|Summary||0021806: Brush.Style = bsClear is ignored|
|Description||The code below|
with PaintBox1.Canvas do begin
Brush.Style := bsClear;
Brush.Color := clRed;
Pen.Style := psDot;
Pen.Color := clBlack;
draws red-black line instead of "transparent"-black.
This is a regression both compared to Delphi and Lazarus 0.9.30
|Steps To Reproduce||Run attached project.|
|Tags||No tags attached.|
|Fixed in Revision|
brush_clear.7z (1,583 bytes)
||Seem that latest brush patches created this problem, but afair in that patches was something that says -> if Brush.Color is changed then Brush is setted up to bsSolid ...|
The behavior changed to 0.9.30 but now it's equal to Delphi.
See screenshots of Delphi and Lazarus version using the report code example.
I'm not saying that this behavior is correct or not.
In fact i noticed this difference between Lazarus and Delphi years ago while porting VirtualTreeView. At that time i reported the difference but the conclusion was that Lazarus behavior was the correct and should not be changed. See http://bugs.freepascal.org/view.php?id=8455
You may also look at http://www.efg2.com/Lab/OtherProjects/PrinterDemo2.htm
More info: according to Delphi help Color property is ignored if Style is bsClear:
"Note: If the value of the Style property is bsClear, the Color property is ignored. Further, any value assigned to the Color property is lost when Style is set to bsClear."
The issue is not a regression but instead logic fixing to match VCL.
If you set a color to brush and it style is bsClear then reset the style to bsSolid.
Screenshots added by Luiz shows how it works in delphi.
In the other side i did the following test in Delphi 7:
if Brush.Style = bsClear then
Brush.Color := clRed;
if Brush.Style = bsSolid then
Both ShowMessage are executed so the Style really changes.
Maybe someone with newer Delphi can test
Ok, but this is a serious incompatible change which should be
advertised in release notes.
|2012-04-19 16:48||Alexander S. Klenin||New Issue|
|2012-04-19 16:48||Alexander S. Klenin||File Added: brush_clear.7z|
|2012-04-19 16:48||Alexander S. Klenin||LazTarget||=> -|
|2012-04-19 17:06||Zeljan Rikalo||Note Added: 0058769|
|2012-04-19 17:06||Zeljan Rikalo||Assigned To||=> Paul Ishenin|
|2012-04-19 17:06||Zeljan Rikalo||Status||new => assigned|
|2012-04-20 00:26||Luiz Americo||File Added: lazarus_clear.png|
|2012-04-20 00:27||Luiz Americo||File Added: delphi_clear.png|
|2012-04-20 00:39||Luiz Americo||Note Added: 0058777|
|2012-04-20 00:42||Luiz Americo||Note Added: 0058778|
|2012-04-20 00:43||Paul Ishenin||Status||assigned => resolved|
|2012-04-20 00:43||Paul Ishenin||Fixed in Version||=> 1.1 (SVN)|
|2012-04-20 00:43||Paul Ishenin||Resolution||open => no change required|
|2012-04-20 00:43||Paul Ishenin||Note Added: 0058779|
|2012-04-20 00:46||Luiz Americo||Note Added: 0058780|
|2012-04-20 01:12||Alexander S. Klenin||Note Added: 0058781|