Pārlūkot izejas kodu

#111 aliasing for shapes

Juliette ELSASS 1 gadu atpakaļ
vecāks
revīzija
cff3eb6fb2

+ 0 - 1
lazpaint/tools/utooltext.pas

@@ -170,7 +170,6 @@ begin
     FontEmHeight:= zoom*Manager.TextFontSize*Manager.Image.DPI/72;
     FontName:= Manager.TextFontName;
     FontStyle:= Manager.TextFontStyle;
-    Aliased := Manager.ShapeOptionAliasing;
     LightPosition := AMatrix*Manager.LightPosition;
     AltitudePercent:= Manager.PhongShapeAltitude;
     if FontBidiMode <> Manager.TextBidiMode then

+ 12 - 4
lazpaint/tools/utoolvectorial.pas

@@ -265,6 +265,8 @@ begin
     result := result + [ctText,ctAliasing];
     if TTextShape(AShape).PenPhong then include(result, ctAltitude);
   end;
+  if vsfAliased in f then
+    result += [ctAliasing];
 end;
 
 procedure AlignShape(AShape: TVectorShape; ACommand: TToolCommand; const AMatrix: TAffineMatrix; const ARect: TRect);
@@ -440,6 +442,12 @@ begin
     AShape.Usermode := vsuEdit;
   opt := Manager.ShapeOptions;
   f := AShape.MultiFields;
+  if vsfAliased in f then
+  begin
+    if AShape.Aliased then
+      include(opt,toAliasing)
+      else exclude(opt,toAliasing);
+  end;
   doDraw := vsfPenFill in f;
   doFill := vsfBackFill in f;
   if vsfPenStyle in f then
@@ -510,9 +518,6 @@ begin
     Manager.TextVerticalAlign:= VerticalAlignment;
     Manager.SetTextFont(FontName, FontEmHeight*zoom*72/Manager.Image.DPI, FontStyle);
     Manager.TextShadow:= false;
-    if Aliased then
-      include(opt,toAliasing)
-      else exclude(opt,toAliasing);
   end;
   Manager.ShapeOptions := opt;
 
@@ -667,6 +672,8 @@ begin
       m := AffineMatrixInverse(Manager.Image.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex]);
       zoom := (VectLen(m[1,1],m[2,1])+VectLen(m[1,2],m[2,2]))/2;
       f := shape.MultiFields;
+      if vsfAliased in f then
+        shape.Aliased := Manager.ShapeOptionAliasing;
       if f*[vsfPenFill,vsfBackFill,vsfPenStyle] = [vsfPenFill,vsfBackFill,vsfPenStyle] then
       begin
         doDraw := toDrawShape in Manager.ShapeOptions;
@@ -725,7 +732,6 @@ begin
         FontName:= Manager.TextFontName;
         FontEmHeight:= Manager.TextFontSize*zoom*Manager.Image.DPI/72;
         FontStyle := Manager.TextFontStyle;
-        Aliased := Manager.ShapeOptionAliasing;
       end;
       if shape is TPhongShape then
       with TPhongShape(shape) do
@@ -1974,6 +1980,8 @@ begin
   zoom := (VectLen(AMatrix[1,1],AMatrix[2,1])+VectLen(AMatrix[1,2],AMatrix[2,2]))/2;
   f := FShape.MultiFields;
   gradBox := FShape.SuggestGradientBox(AffineMatrixIdentity);
+  if vsfAliased in f then
+    FShape.Aliased:= Manager.ShapeOptionAliasing;
   if vsfPenFill in f then
   begin
     if HasPen then

+ 37 - 3
lazpaintcontrols/lcvectororiginal.pas

@@ -43,7 +43,8 @@ type
 
   TRenderBoundsOption = (rboAssumePenFill, rboAssumeBackFill);
   TRenderBoundsOptions = set of TRenderBoundsOption;
-  TVectorShapeField = (vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle, vsfBackFill, vsfOutlineFill, vsfOutlineWidth);
+  TVectorShapeField = (vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle,
+                    vsfBackFill, vsfOutlineFill, vsfOutlineWidth, vsfAliased);
   TVectorShapeFields = set of TVectorShapeField;
   TVectorShapeUsermode = (vsuEdit, vsuCreate, vsuEditPenFill, vsuEditBackFill, vsuEditOutlineFill,
                           vsuCurveSetAuto, vsuCurveSetCurve, vsuCurveSetAngle,
@@ -117,10 +118,12 @@ type
 
   TVectorShapeCommonDiff = class(TVectorShapeDiff)
   protected
+    FStartAliased: boolean;
     FStartPenWidth: single;
     FStartPenStyle: TBGRAPenStyle;
     FStartOutlineWidth: single;
     FStartJoinStyle: TPenJoinStyle;
+    FEndAliased: boolean;
     FEndPenWidth: single;
     FEndPenStyle: TBGRAPenStyle;
     FEndOutlineWidth: single;
@@ -201,13 +204,16 @@ type
     FDiffs: TVectorShapeDiffList;
     FFillBeforeChangeBounds: TRectF;
     function GetIsUpdating: boolean;
+    procedure SetAliased(AValue: boolean);
     procedure SetContainer(AValue: TVectorOriginal);
     function GetFill(var AFillVariable: TVectorialFill): TVectorialFill;
     procedure SetFill(var AFillVariable: TVectorialFill; AValue: TVectorialFill; AUpdate: boolean);
     procedure SetId(AValue: integer);
   protected
-    FPenWidth: single;
+    FAliased: boolean;
     FOutlineWidth: single;
+    FPenWidth: single;
+
     FFillChangeWithoutUpdate: boolean;
     procedure BeginEditingUpdate;
     procedure EndEditingUpdate;
@@ -257,6 +263,7 @@ type
       ADefs: TSVGDefine; ANamePrefix: string): string;
     procedure ApplyStrokeStyleToSVG(AElement: TSVGElement; ADefs: TSVGDefine);
     procedure ApplyFillStyleToSVG(AElement: TSVGElement; ADefs: TSVGDefine);
+    procedure ApplyAliasingToSVG(AElement: TSVGElement);
     property Stroker: TBGRAPenStroker read GetStroker;
   public
     constructor Create(AContainer: TVectorOriginal); virtual;
@@ -331,6 +338,7 @@ type
     property Id: integer read FId write SetId;
     property IsFollowingMouse: boolean read GetIsFollowingMouse;
     property IsUpdating: boolean read GetIsUpdating;
+    property Aliased: boolean read FAliased write SetAliased;
     property BackVisible: boolean read GetBackVisible;
     property PenVisible: boolean read GetPenVisibleNow;
     property OutlineVisible: boolean read GetOutlineVisible;
@@ -1011,6 +1019,7 @@ constructor TVectorShapeCommonDiff.Create(AStartShape: TVectorShape);
 begin
   with AStartShape do
   begin
+    FStartAliased:= Aliased;
     FStartPenWidth:= PenWidth;
     FStartPenStyle:= DuplicatePenStyle(PenStyle);
     FStartOutlineWidth:= OutlineWidth;
@@ -1022,6 +1031,7 @@ procedure TVectorShapeCommonDiff.ComputeDiff(AEndShape: TVectorShape);
 begin
   with AEndShape do
   begin
+    FEndAliased:= Aliased;
     FEndPenWidth:= PenWidth;
     FEndPenStyle:= DuplicatePenStyle(PenStyle);
     FEndOutlineWidth:= OutlineWidth;
@@ -1034,6 +1044,7 @@ begin
   with AStartShape do
   begin
     BeginUpdate;
+    FAliased:= FEndAliased;
     FPenWidth := FEndPenWidth;
     Stroker.CustomPenStyle := DuplicatePenStyle(FEndPenStyle);
     FOutlineWidth := FEndOutlineWidth;
@@ -1047,6 +1058,7 @@ begin
   with AEndShape do
   begin
     BeginUpdate;
+    FAliased:= FStartAliased;
     FPenWidth := FStartPenWidth;
     Stroker.CustomPenStyle := DuplicatePenStyle(FStartPenStyle);
     FOutlineWidth := FStartOutlineWidth;
@@ -1060,6 +1072,7 @@ var
   next: TVectorShapeCommonDiff;
 begin
   next := ADiff as TVectorShapeCommonDiff;
+  FEndAliased:= next.FEndAliased;
   FEndPenWidth:= next.FEndPenWidth;
   FEndPenStyle:= DuplicatePenStyle(next.FEndPenStyle);
   FEndOutlineWidth:= next.FEndOutlineWidth;
@@ -1068,7 +1081,8 @@ end;
 
 function TVectorShapeCommonDiff.IsIdentity: boolean;
 begin
-  result := (FStartPenWidth = FEndPenWidth) and
+  result := (FStartAliased = FEndAliased) and
+    (FStartPenWidth = FEndPenWidth) and
     PenStyleEqual(FStartPenStyle, FEndPenStyle) and
     (FStartOutlineWidth = FEndOutlineWidth) and
     (FStartJoinStyle = FEndJoinStyle);
@@ -1775,6 +1789,14 @@ begin
   result := FUpdateCount > 0;
 end;
 
+procedure TVectorShape.SetAliased(AValue: boolean);
+begin
+  if FAliased=AValue then Exit;
+  BeginUpdate(TVectorShapeCommonDiff);
+  FAliased:=AValue;
+  EndUpdate;
+end;
+
 function TVectorShape.GetOutlineWidth: single;
 begin
   result := FOutlineWidth;
@@ -1940,6 +1962,12 @@ begin
   else AElement.fillNone;
 end;
 
+procedure TVectorShape.ApplyAliasingToSVG(AElement: TSVGElement);
+begin
+  if Aliased then
+    AElement.shapeRendering:= 'crispEdges';
+end;
+
 procedure TVectorShape.TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean);
 begin
   BeginUpdate;
@@ -2430,6 +2458,7 @@ begin
     if vsfBackFill in f then LoadFill(AStorage, 'back', FBackFill);
     if vsfOutlineFill in f then LoadFill(AStorage, 'outline', FOutlineFill);
     if vsfOutlineWidth in f then OutlineWidth := AStorage.FloatDef['outline-width', DefaultShapeOutlineWidth];
+    if vsfAliased in f then Aliased:= AStorage.BoolDef['aliased', false];
     EndUpdate;
   end;
 end;
@@ -2462,6 +2491,11 @@ begin
     AStorage.RemoveAttribute('outline-color');
     AStorage.RemoveAttribute('outline-width');
   end;
+  if vsfAliased in f then
+  begin
+    if not Aliased then AStorage.RemoveAttribute('aliased')
+    else AStorage.Bool['aliased'] := Aliased;
+  end;
 end;
 
 procedure TVectorShape.MouseMove(Shift: TShiftState; X, Y: single; var

+ 4 - 3
lazpaintcontrols/lcvectorpolyshapes.pas

@@ -1258,7 +1258,7 @@ end;
 
 class function TPolylineShape.Fields: TVectorShapeFields;
 begin
-  Result:= [vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle, vsfBackFill];
+  Result:= [vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle, vsfBackFill, vsfAliased];
 end;
 
 procedure TPolylineShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix;
@@ -1274,7 +1274,7 @@ begin
     if BackFill.FillType = vftSolid then backScan := nil
     else backScan := BackFill.CreateScanner(AMatrix, ADraft);
 
-    if ADraft then
+    if ADraft or Aliased then
     begin
       if Assigned(backScan) then
         ADest.FillPoly(pts, backScan, dmDrawWithTransparency) else
@@ -1295,7 +1295,7 @@ begin
     else penScan := PenFill.CreateScanner(AMatrix, ADraft);
 
     pts := ComputeStroke(pts, Closed, AMatrix);
-    if ADraft and (PenWidth > 4) then
+    if (ADraft and (PenWidth > 4)) or Aliased then
     begin
       if Assigned(penScan) then
         ADest.FillPoly(pts, penScan, dmDrawWithTransparency) else
@@ -1323,6 +1323,7 @@ begin
   if PenVisible then
     result.strokeLineCapLCL := LineCap;
   ApplyFillStyleToSVG(result, ADefs);
+  ApplyAliasingToSVG(result);
 end;
 
 function TPolylineShape.GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions): TRectF;

+ 15 - 13
lazpaintcontrols/lcvectorrectshapes.pas

@@ -927,7 +927,7 @@ end;
 
 class function TRectShape.Fields: TVectorShapeFields;
 begin
-  Result:= [vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle, vsfBackFill];
+  Result:= [vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle, vsfBackFill, vsfAliased];
 end;
 
 function TRectShape.AppendToSVG(AContent: TSVGContent; ADefs: TSVGDefine): TSVGElement;
@@ -973,6 +973,7 @@ begin
     result.Matrix[cuPixel] := m;
     ApplyStrokeStyleToSVG(result, ADefs);
     ApplyFillStyleToSVG(result, ADefs);
+    ApplyAliasingToSVG(result);
   end;
 end;
 
@@ -995,7 +996,7 @@ begin
 
     if GetOrthoRect(AMatrix, orthoRect) then
     begin
-      if ADraft then
+      if ADraft or Aliased then
       begin
         r:= rect(round(orthoRect.Left+0.5),round(orthoRect.Top+0.5),round(orthoRect.Right+0.5),round(orthoRect.Bottom+0.5));
         if Assigned(backScan) then
@@ -1023,7 +1024,7 @@ begin
       end;
     end else
     begin
-      if ADraft then
+      if ADraft or Aliased then
       begin
         if Assigned(backScan) then
           ADest.FillPoly(pts, backScan, dmDrawWithTransparency) else
@@ -1059,7 +1060,7 @@ begin
     else penScan := PenFill.CreateScanner(AMatrix, ADraft);
 
     pts := ComputeStroke(pts,true, AMatrix);
-    if ADraft and (PenWidth > 4) then
+    if (ADraft and (PenWidth > 4)) or Aliased then
     begin
       if Assigned(penScan) then
         ADest.FillPoly(pts, penScan, dmDrawWithTransparency) else
@@ -1195,7 +1196,7 @@ end;
 
 class function TEllipseShape.Fields: TVectorShapeFields;
 begin
-  Result:= [vsfPenFill, vsfPenWidth, vsfPenStyle, vsfBackFill];
+  Result:= [vsfPenFill, vsfPenWidth, vsfPenStyle, vsfBackFill, vsfAliased];
 end;
 
 function TEllipseShape.AppendToSVG(AContent: TSVGContent; ADefs: TSVGDefine): TSVGElement;
@@ -1219,6 +1220,7 @@ begin
   end;
   ApplyStrokeStyleToSVG(result, ADefs);
   ApplyFillStyleToSVG(result, ADefs);
+  ApplyAliasingToSVG(result);
 end;
 
 function TEllipseShape.GetAlignBounds(const ALayoutRect: TRect;
@@ -1264,7 +1266,7 @@ var
   pts: Array of TPointF;
   orthoRect: TRectF;
   center, radius: TPointF;
-  draftPen, isOrtho: Boolean;
+  aliasedPen, isOrtho: Boolean;
   r: TRect;
   backScan, penScan: TBGRACustomScanner;
   penZoom: Single;
@@ -1280,7 +1282,7 @@ begin
       if BackFill.FillType = vftSolid then backScan := nil
       else backScan := BackFill.CreateScanner(AMatrix, ADraft);
 
-      if ADraft then
+      if ADraft or Aliased then
       begin
         r := rect(round(orthoRect.Left),round(orthoRect.Top),round(orthoRect.Right),round(orthoRect.Bottom));
         if Assigned(backScan) then
@@ -1300,13 +1302,13 @@ begin
     begin
       if PenFill.FillType = vftSolid then penScan := nil
       else penScan := PenFill.CreateScanner(AMatrix, ADraft);
-      draftPen := ADraft and (PenWidth > 4);
+      aliasedPen := (ADraft and (PenWidth > 4)) or Aliased;
 
-      if IsAffineMatrixScaledRotation(AMatrix) and not (draftPen and Assigned(penScan)) then
+      if IsAffineMatrixScaledRotation(AMatrix) and not (aliasedPen and Assigned(penScan)) then
       begin
         penZoom := VectLen(AMatrix[1,1],AMatrix[2,1]);
         ADest.CustomPenStyle := PenStyle;
-        if draftPen then
+        if aliasedPen then
           ADest.Ellipse(center.x, center.y, radius.x, radius.y, PenColor, PenWidth*penZoom, dmDrawWithTransparency)
         else
         begin
@@ -1320,7 +1322,7 @@ begin
         m:= MatrixForPixelCentered(AMatrix);
         pts := ComputeEllipse(m*FOrigin, m*FXAxis, m*FYAxis);
         pts := ComputeStroke(pts,true, AMatrix);
-        if draftPen then
+        if aliasedPen then
         begin
           if Assigned(penScan) then
             ADest.FillPoly(pts, penScan, dmDrawWithTransparency) else
@@ -1345,7 +1347,7 @@ begin
       if BackFill.FillType = vftSolid then backScan := nil
       else backScan := BackFill.CreateScanner(AMatrix, ADraft);
 
-      if ADraft then
+      if ADraft or Aliased then
       begin
         if Assigned(backScan) then
           ADest.FillPoly(pts, backScan, dmDrawWithTransparency) else
@@ -1366,7 +1368,7 @@ begin
       else penScan := PenFill.CreateScanner(AMatrix, ADraft);
 
       pts := ComputeStroke(pts,true, AMatrix);
-      if ADraft and (PenWidth > 4) then
+      if (ADraft and (PenWidth > 4)) or Aliased then
       begin
         if Assigned(penScan) then
           ADest.FillPoly(pts, penScan, dmDrawWithTransparency) else

+ 6 - 27
lazpaintcontrols/lcvectortextshapes.pas

@@ -21,12 +21,10 @@ type
     FFontEmHeightBefore: single;
     FFontNameBefore: string;
     FFontStyleBefore: TFontStyles;
-    FAliasedBefore: boolean;
     FFontBidiModeAfter: TFontBidiMode;
     FFontEmHeightAfter: single;
     FFontNameAfter: string;
     FFontStyleAfter: TFontStyles;
-    FAliasedAfter: boolean;
   public
     constructor Create(AStartShape: TVectorShape); override;
     procedure ComputeDiff(AEndShape: TVectorShape); override;
@@ -80,7 +78,6 @@ type
 
   TTextShape = class(TCustomRectShape)
   private
-    FAliased: boolean;
     FAltitudePercent: single;
     FPenPhong: boolean;
     FPenFillIteration: integer;
@@ -112,7 +109,6 @@ type
       {%H-}ASubBrokenIndex, {%H-}ACharIndex: integer);
     procedure OnMoveLightPos({%H-}ASender: TObject; {%H-}APrevCoord, ANewCoord: TPointF;
       {%H-}AShift: TShiftState);
-    procedure SetAliased(AValue: boolean);
     procedure SetAltitudePercent(AValue: single);
     procedure SetPenPhong(AValue: boolean);
     procedure SetFontBidiMode(AValue: TFontBidiMode);
@@ -207,7 +203,6 @@ type
     property PenPhong: boolean read FPenPhong write SetPenPhong;
     property LightPosition: TPointF read FLightPosition write SetLightPosition;
     property AltitudePercent: single read FAltitudePercent write SetAltitudePercent;
-    property Aliased: boolean read FAliased write SetAliased;
   end;
 
 function FontStyleToStr(AStyle: TFontStyles): string;
@@ -471,7 +466,6 @@ begin
     FFontEmHeightBefore:= FFontEmHeight;
     FFontNameBefore:= FFontName;
     FFontStyleBefore:= FFontStyle;
-    FAliasedBefore := FAliased;
   end;
 end;
 
@@ -483,7 +477,6 @@ begin
     FFontEmHeightAfter:= FFontEmHeight;
     FFontNameAfter:= FFontName;
     FFontStyleAfter:= FFontStyle;
-    FAliasedAfter := FAliased;
   end;
 end;
 
@@ -496,7 +489,6 @@ begin
     FFontEmHeight := FFontEmHeightAfter;
     FFontName := FFontNameAfter;
     FFontStyle := FFontStyleAfter;
-    FAliased := FAliasedAfter;
     if Assigned(FTextLayout) then FTextLayout.InvalidateLayout;
     EndUpdate;
   end;
@@ -511,7 +503,6 @@ begin
     FFontEmHeight := FFontEmHeightBefore;
     FFontName := FFontNameBefore;
     FFontStyle := FFontStyleBefore;
-    FAliased := FAliasedBefore;
     if Assigned(FTextLayout) then FTextLayout.InvalidateLayout;
     EndUpdate;
   end;
@@ -526,7 +517,6 @@ begin
   FFontEmHeightAfter := next.FFontEmHeightAfter;
   FFontNameAfter := next.FFontNameAfter;
   FFontStyleAfter := next.FFontStyleAfter;
-  FAliasedAfter := next.FAliasedAfter;
 end;
 
 function TTextShapeFontDiff.IsIdentity: boolean;
@@ -534,8 +524,7 @@ begin
   result := (FFontBidiModeBefore = FFontBidiModeAfter) and
     (FFontEmHeightBefore = FFontEmHeightAfter) and
     (FFontNameBefore = FFontNameAfter) and
-    (FFontStyleBefore = FFontStyleAfter) and
-    (FAliasedBefore = FAliasedAfter);
+    (FFontStyleBefore = FFontStyleAfter);
 end;
 
 { TTextShape }
@@ -684,15 +673,6 @@ begin
   LightPosition := ANewCoord;
 end;
 
-procedure TTextShape.SetAliased(AValue: boolean);
-begin
-  if FAliased=AValue then Exit;
-  BeginUpdate(TTextShapeFontDiff);
-  FAliased:=AValue;
-  InvalidateAll;
-  EndUpdate;
-end;
-
 procedure TTextShape.SetAltitudePercent(AValue: single);
 begin
   if AValue < 0 then AValue := 0;
@@ -1186,7 +1166,6 @@ begin
   FPenFillIteration := 0;
   FAltitudePercent:= DefaultAltitudePercent;
   FLightPosition := PointF(0,0);
-  FAliased := false;
   FCurBrokenLineImageId := 0;
 end;
 
@@ -1247,8 +1226,6 @@ begin
   end else
     SetDefaultFont;
 
-  Aliased := AStorage.Bool['aliased'];
-
   phongObj := AStorage.OpenObject('pen-phong');
   PenPhong := Assigned(phongObj);
   if PenPhong then
@@ -1299,7 +1276,6 @@ begin
   font.RawString['bidi'] := FontBidiModeToStr(FontBidiMode);
   font.RawString['style'] := FontStyleToStr(FontStyle);
   font.Free;
-  AStorage.Bool['aliased'] := Aliased;
 
   if PenPhong then
   begin
@@ -1340,7 +1316,7 @@ end;
 
 class function TTextShape.Fields: TVectorShapeFields;
 begin
-  Result:= [vsfPenFill,vsfOutlineFill,vsfOutlineWidth];
+  Result:= [vsfPenFill,vsfOutlineFill,vsfOutlineWidth,vsfAliased];
 end;
 
 class function TTextShape.PreferPixelCentered: boolean;
@@ -1886,7 +1862,8 @@ begin
   begin
     tempRenderNewList := TStringList.Create;
     useBrokenLinesRender := not ADraft and (Usermode = vsuEditText);
-    if not tempStorage.AffineMatrixEquals('last-matrix', AMatrix) or
+    if (tempStorage.Bool['aliased'] <> Aliased) or
+       not tempStorage.AffineMatrixEquals('last-matrix', AMatrix) or
        not tempStorage.PointFEquals('origin', Origin) or
        not tempStorage.PointFEquals('x-axis', XAxis) or
        not tempStorage.PointFEquals('y-axis', YAxis) or
@@ -1900,6 +1877,7 @@ begin
         tempStorage.RemoveObject(tempRenderCurList[fileIdx]);
       tempRenderCurList.Free;
 
+      tempStorage.RemoveAttribute('aliased');
       tempStorage.RemoveAttribute('last-matrix');
       tempStorage.RemoveAttribute('origin');
       tempStorage.RemoveAttribute('x-axis');
@@ -2100,6 +2078,7 @@ begin
         tempStorage.RemoveObject(tempRenderCurList[fileIdx]);
     tempRenderCurList.Free;
 
+    tempStorage.Bool['aliased'] := Aliased;
     tempStorage.AffineMatrix['last-matrix'] := AMatrix;
     tempStorage.PointF['origin'] := Origin;
     tempStorage.PointF['x-axis'] := XAxis;