Error while building delphi package, fmx.castlecontrol.pas

I am using Windows 10 and Delphi 10.3 community. I installed CGE on my system. I opened AllPackages.groupproj in the …/packages/delphi directory. When I hit build all, I get below error. I set target as 32 bit Windows.

Error:
[dcc32 Error] fmx.castlecontrol.pas(359): E2250 There is no overloaded version of ‘FillRect’ that can be called with these arguments

Related routine(line 359, Canvas.FillRect(R, 1.0)):

procedure TCastleControl.Paint;
var
  R: TRectF;
begin
  { See our constructor comments:
    looks like native drawing at design-time in FMX is just not possible reliably. }

  if csDesigning in ComponentState then
  begin
    inherited;
    R := LocalRect;

    Canvas.Fill.Kind := TBrushKind.Solid;
    Canvas.Fill.Color := $A0909090;
    Canvas.FillRect(R, 1.0);

    Canvas.Fill.Color := TAlphaColors.Yellow;
    Canvas.FillText(R,
      'Run the project to see actual rendering of ' + Name + ' (' + ClassName + ')',
      true, 1.0, [], TTextAlign.Center);
  end else
  begin
    // inherited not needed, and possibly causes something unnecessary
    FContainer.DoRender;
  end;
end;

Thank you for reporting! Embarcadero docs confirm that 10.3 doesn’t have the FillRect we use,

As I don’t have 10.3 available for testing now, can you confirm on your side that changing

Canvas.FillRect(R, 1.0);

Canvas.FillRect(R, 0, 0, [], 1.0);

helps? I can commit it to CGE then.

Aside from it, I would advise to upgrade to Delphi 10.4. The latest Community version is 10.4, so it is free, and this is better tested by us :slight_smile:

Yes, it worked. Thanks a lot for the quick response.

Cool, thanks for confirming. I committed this change then: Fix Canvas.FillRect call to work with Delphi 10.3 · castle-engine/castle-engine@0344d72 · GitHub .