Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread canvas.shadowColor := clBlack
Wed, Feb 1 2017 3:01 AMPermanent Link

R&D team @ Environment Canada

g'day

We have noticed that setting the TCanvasElement 'shadowColor' property to 'clBlack' (or $FF000000) results in no shadow at all. 'clBlack' is also the default color if it is not explicitly set - so setting a shadow does not do anything unless you specify a color.

Quick work-around is to set the shadow color to $FF010101, which is pretty well black anyway!

This is with EWB 2.05b3, but I think this 'issue' has been there since EWB 1. Not sure though.

.. Bruno
Thu, Feb 2 2017 2:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Bruno,

<< We have noticed that setting the TCanvasElement 'shadowColor' property to 'clBlack' (or $FF000000) results in no shadow at all. 'clBlack' is also the default color if it is not explicitly set - so setting a shadow does not do anything unless you specify a color.

Quick work-around is to set the shadow color to $FF010101, which is pretty well black anyway!

This is with EWB 2.05b3, but I think this 'issue' has been there since EWB 1. Not sure though. >>

Yeah, it's another Reset issue, and here's the hot fix:

procedure TCanvasElement.Reset;
begin
  FAlpha:=1;
  FCompositeOperation:=coSourceOver;
  FFillStyle:=dsColor;
  FFillColor:=clBlack;
  FFillGradient.Free;
  FFillGradient:=TCanvasGradient.Create(Self);
  FFillPattern.Free;
  FFillPattern:=TCanvasPattern.Create(Self);
  FLineCapStyle:=csButt;
  FLineJoinStyle:=jsMiter;
  FLineWidth:=1;
  FMiterLimit:=10;
  FShadowBlur:=0;
  FShadowColor:=clBlack;
  FContext.shadowColor:=ColorToRGBAStr(FShadowColor);  <<<<<<<<<<<<<<<<  Add !!!!
.................

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 2 2017 3:43 PMPermanent Link

R&D team @ Environment Canada

super, thanks Tim!

Tim Young [Elevate Software] wrote:

Bruno,

<< We have noticed that setting the TCanvasElement 'shadowColor' property to 'clBlack' (or $FF000000) results in no shadow at all. 'clBlack' is also the default color if it is not explicitly set - so setting a shadow does not do anything unless you specify a color.

Quick work-around is to set the shadow color to $FF010101, which is pretty well black anyway!

This is with EWB 2.05b3, but I think this 'issue' has been there since EWB 1. Not sure though. >>

Yeah, it's another Reset issue, and here's the hot fix:

procedure TCanvasElement.Reset;
begin
  FAlpha:=1;
  FCompositeOperation:=coSourceOver;
  FFillStyle:=dsColor;
  FFillColor:=clBlack;
  FFillGradient.Free;
  FFillGradient:=TCanvasGradient.Create(Self);
  FFillPattern.Free;
  FFillPattern:=TCanvasPattern.Create(Self);
  FLineCapStyle:=csButt;
  FLineJoinStyle:=jsMiter;
  FLineWidth:=1;
  FMiterLimit:=10;
  FShadowBlur:=0;
  FShadowColor:=clBlack;
  FContext.shadowColor:=ColorToRGBAStr(FShadowColor);  <<<<<<<<<<<<<<<<  Add !!!!
.................

Tim Young
Elevate Software
www.elevatesoft.com
Image