|
@@ -618,10 +618,19 @@ var
|
|
begin
|
|
begin
|
|
if El=nil then ;
|
|
if El=nil then ;
|
|
|
|
|
|
- With Params.BoundingBox.Box do
|
|
|
|
|
|
+ With Params do
|
|
begin
|
|
begin
|
|
- r:=RectF(0,0,Width,Height);
|
|
|
|
- r.Offset(Left+Origin.X,Top+Origin.Y);
|
|
|
|
|
|
+ if HasBorder then begin
|
|
|
|
+ // with border
|
|
|
|
+ r:=RectF(Width[ffsLeft]/2,
|
|
|
|
+ Width[ffsTop]/2,
|
|
|
|
+ BoundingBox.Box.Width-Width[ffsRight]/2,
|
|
|
|
+ BoundingBox.Box.Height-Width[ffsBottom]/2);
|
|
|
|
+ end else begin
|
|
|
|
+ // no border
|
|
|
|
+ r:=RectF(0,0,BoundingBox.Box.Width,BoundingBox.Box.Height);
|
|
|
|
+ end;
|
|
|
|
+ r.Offset(BoundingBox.Box.Left+Origin.X,BoundingBox.Box.Top+Origin.Y);
|
|
end;
|
|
end;
|
|
|
|
|
|
if Params.BackgroundImage is TFresnelCSSLinearGradient then
|
|
if Params.BackgroundImage is TFresnelCSSLinearGradient then
|
|
@@ -661,7 +670,6 @@ end;
|
|
procedure TFresnelSkiaRenderer.DrawElBorder(El: TFresnelElement; Params: TBorderAndBackground);
|
|
procedure TFresnelSkiaRenderer.DrawElBorder(El: TFresnelElement; Params: TBorderAndBackground);
|
|
|
|
|
|
var
|
|
var
|
|
- HasBorder, HasRadius, SameBorderWidth: Boolean;
|
|
|
|
r: TRectF;
|
|
r: TRectF;
|
|
SkPaint: ISkPaint;
|
|
SkPaint: ISkPaint;
|
|
Oval: ISkRoundRect;
|
|
Oval: ISkRoundRect;
|
|
@@ -671,9 +679,6 @@ begin
|
|
if El=nil then ;
|
|
if El=nil then ;
|
|
// Radii are calculated in prepare step.
|
|
// Radii are calculated in prepare step.
|
|
|
|
|
|
- SameBorderWidth:=Params.SameBorderWidth;
|
|
|
|
- HasBorder:=Params.HasBorder;
|
|
|
|
- HasRadius:=Params.HasRadius;
|
|
|
|
With Params do
|
|
With Params do
|
|
begin
|
|
begin
|
|
if HasBorder then begin
|
|
if HasBorder then begin
|
|
@@ -691,14 +696,14 @@ begin
|
|
//writeln('TFresnelSkiaRenderer.DrawElBorder ',El.GetPath,' Box=',Params.Box.ToString,' Origin=',Origin.ToString,' r=',r.Left,',',r.Top,',',r.Right,',',r.Bottom);
|
|
//writeln('TFresnelSkiaRenderer.DrawElBorder ',El.GetPath,' Box=',Params.Box.ToString,' Origin=',Origin.ToString,' r=',r.Left,',',r.Top,',',r.Right,',',r.Bottom);
|
|
|
|
|
|
// draw border
|
|
// draw border
|
|
- if HasBorder then
|
|
|
|
|
|
+ if Params.HasBorder then
|
|
begin
|
|
begin
|
|
- if not SameBorderWidth then ; // todo
|
|
|
|
|
|
+ if not Params.SameBorderWidth then ; // todo
|
|
SkPaint:=TSkPaint.Create(TSkPaintStyle.Stroke);
|
|
SkPaint:=TSkPaint.Create(TSkPaintStyle.Stroke);
|
|
SkPaint.setColor(FPColorToSkia(Params.Color[ffsLeft]));
|
|
SkPaint.setColor(FPColorToSkia(Params.Color[ffsLeft]));
|
|
SkPaint.SetStrokeWidth(Params.Width[ffsLeft]);
|
|
SkPaint.SetStrokeWidth(Params.Width[ffsLeft]);
|
|
SkPaint.SetAntiAlias(true);
|
|
SkPaint.SetAntiAlias(true);
|
|
- if HasRadius then
|
|
|
|
|
|
+ if Params.HasRadius then
|
|
begin
|
|
begin
|
|
Oval:=TSkRoundRect.Create;
|
|
Oval:=TSkRoundRect.Create;
|
|
Oval.SetRect(r,SkiaParams.Radii);
|
|
Oval.SetRect(r,SkiaParams.Radii);
|