Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FMX] Linear Gradient not working #224

Closed
davidberneda opened this issue Apr 20, 2023 · 5 comments
Closed

[FMX] Linear Gradient not working #224

davidberneda opened this issue Apr 20, 2023 · 5 comments

Comments

@davidberneda
Copy link

davidberneda commented Apr 20, 2023

It seems linear gradients do not work properly, nothing gets painted, here's a small example:

// GlobalUseSkia:=True <-- at .dpr

procedure TForm1.PaintBox1Paint(Sender: TObject; Canvas: TCanvas);
var Brush : TBrush;
    R : TRectF;
begin
  R:=PaintBox1.LocalRect;

  Brush:=TBrush.Create(TBrushKind.Gradient,TAlphaColors.Green);
  try
    Brush.Gradient.Color:=TAlphaColors.Green;
    Brush.Gradient.Color1:=TAlphaColors.Yellow;

//    Brush.Gradient.Style:=TGradientStyle.Linear;
//    Brush.Gradient.StartPosition.X:=0;
//    Brush.Gradient.StartPosition.Y:=0;
//    Brush.Gradient.StopPosition.X:=0;
//    Brush.Gradient.StopPosition.Y:=1;

    Canvas.FillRect(R,1,Brush);
  finally
    Brush.Free;
  end;
end;


@checkdigits
Copy link

// GlobalUseSkia:=True <-- at .dpr

You have the Skia library commented out - did you mean to do that?

@davidberneda
Copy link
Author

No, its just for clarification. Without Skia the gradient is painted correctly, with Skia its not (nothing gets painted).

@TheOriginalBytePlayer
Copy link

This is the same issue as reported by #217 (comment) as styled controls often heavily use gradients.

@checkdigits
Copy link

I've added a comment about this to the original issue too: #217 (comment)

@paulocesarbot
Copy link
Collaborator

Fixed on new version 6.0.0-beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Status: Done
Development

No branches or pull requests

4 participants