Einzelnen Beitrag anzeigen

QuickAndDirty

Registriert seit: 13. Jan 2004
Ort: Hamm(Westf)
1.944 Beiträge
 
Delphi 12 Athens
 
#1

FMX TPath für SVG Patchen

  Alt 13. Mär 2023, 13:44
TPath aus FMX.Objects kann
von folgenden SVG Path commands
Code:
    MoveTo: M, m
    LineTo: L, l, H, h, V, v
    Cubic Bézier Curve: C, c, S, s
    Quadratic Bézier Curve: Q, q, T, t
    Elliptical Arc Curve: A, a
    ClosePath: Z, z
Quelle: https://developer.mozilla.org/en-US/...#path_commands

QqTt nicht.

Ich denke die Ursache ist, dass FMX.Graphics.TPathData.SetPathString alle PathCommands rendert außer eben QqTt...
'C' wird wie folgt gerendert:
Delphi-Quellcode:
'C':
begin
  CurvePoint1 := GetPointFromString(PathString, Pos);
  CurvePoint2 := GetPointFromString(PathString, Pos);
  CurveTo(CurvePoint1, CurvePoint2, GetPointFromString(PathString, Pos));
  while HasRelativeOffset(PathString, Pos) do
  begin
    CurvePoint1 := GetPointFromString(PathString, Pos);
    CurvePoint2 := GetPointFromString(PathString, Pos);
    CurveTo(CurvePoint1, CurvePoint2, GetPointFromString(PathString, Pos));
  end;
end;
wäre es dann richtig 'Q' ebenso zu rendern nur eben eben mit Curvepoint2 := Curvepoint1 ?
Delphi-Quellcode:
'Q':
begin
  CurvePoint1 := GetPointFromString(PathString, Pos);
  CurvePoint2 := CurvePoint1;
  CurveTo(CurvePoint1, CurvePoint2, GetPointFromString(PathString, Pos));
  while HasRelativeOffset(PathString, Pos) do
  begin
    CurvePoint1 := GetPointFromString(PathString, Pos);
    CurvePoint2 := CurvePoint1;
    CurveTo(CurvePoint1, CurvePoint2, GetPointFromString(PathString, Pos));
  end;
end;
Muss noch eine andere Stelle gepatched werden?
Andreas
Monads? Wtf are Monads?
  Mit Zitat antworten Zitat