|
@@ -71,8 +71,8 @@ type
|
|
procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override;
|
|
procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override;
|
|
function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; {%H-}AOptions: TRenderBoundsOptions = []): TRectF; override;
|
|
function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; {%H-}AOptions: TRenderBoundsOptions = []): TRectF; override;
|
|
procedure ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); override;
|
|
procedure ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); override;
|
|
- function GetAffineBox(AMatrix: TAffineMatrix; APixelCentered: boolean): TAffineBox;
|
|
|
|
- procedure Transform(AMatrix: TAffineMatrix); override;
|
|
|
|
|
|
+ function GetAffineBox(const AMatrix: TAffineMatrix; APixelCentered: boolean): TAffineBox;
|
|
|
|
+ procedure Transform(const AMatrix: TAffineMatrix); override;
|
|
property Origin: TPointF read FOrigin write SetOrigin;
|
|
property Origin: TPointF read FOrigin write SetOrigin;
|
|
property XAxis: TPointF read FXAxis write SetXAxis;
|
|
property XAxis: TPointF read FXAxis write SetXAxis;
|
|
property YAxis: TPointF read FYAxis write SetYAxis;
|
|
property YAxis: TPointF read FYAxis write SetYAxis;
|
|
@@ -93,7 +93,7 @@ type
|
|
procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override;
|
|
procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override;
|
|
function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override;
|
|
function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override;
|
|
function PointInShape(APoint: TPointF): boolean; override;
|
|
function PointInShape(APoint: TPointF): boolean; override;
|
|
- function GetIsSlow(AMatrix: TAffineMatrix): boolean; override;
|
|
|
|
|
|
+ function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override;
|
|
class function StorageClassName: RawByteString; override;
|
|
class function StorageClassName: RawByteString; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -110,7 +110,7 @@ type
|
|
procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override;
|
|
procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override;
|
|
function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override;
|
|
function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override;
|
|
function PointInShape(APoint: TPointF): boolean; override;
|
|
function PointInShape(APoint: TPointF): boolean; override;
|
|
- function GetIsSlow(AMatrix: TAffineMatrix): boolean; override;
|
|
|
|
|
|
+ function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override;
|
|
class function StorageClassName: RawByteString; override;
|
|
class function StorageClassName: RawByteString; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -173,8 +173,8 @@ type
|
|
procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override;
|
|
procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override;
|
|
function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override;
|
|
function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override;
|
|
function PointInShape(APoint: TPointF): boolean; override;
|
|
function PointInShape(APoint: TPointF): boolean; override;
|
|
- function GetIsSlow(AMatrix: TAffineMatrix): boolean; override;
|
|
|
|
- procedure Transform(AMatrix: TAffineMatrix); override;
|
|
|
|
|
|
+ function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override;
|
|
|
|
+ procedure Transform(const AMatrix: TAffineMatrix); override;
|
|
class function StorageClassName: RawByteString; override;
|
|
class function StorageClassName: RawByteString; override;
|
|
property ShapeKind: TPhongShapeKind read FShapeKind write SetShapeKind;
|
|
property ShapeKind: TPhongShapeKind read FShapeKind write SetShapeKind;
|
|
property LightPosition: TPointF read FLightPosition write SetLightPosition;
|
|
property LightPosition: TPointF read FLightPosition write SetLightPosition;
|
|
@@ -649,7 +649,7 @@ begin
|
|
if FYSizeBackup <> 0 then FYUnitBackup := (1/FYSizeBackup)*FYUnitBackup;
|
|
if FYSizeBackup <> 0 then FYUnitBackup := (1/FYSizeBackup)*FYUnitBackup;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TCustomRectShape.GetAffineBox(AMatrix: TAffineMatrix; APixelCentered: boolean): TAffineBox;
|
|
|
|
|
|
+function TCustomRectShape.GetAffineBox(const AMatrix: TAffineMatrix; APixelCentered: boolean): TAffineBox;
|
|
var
|
|
var
|
|
m: TAffineMatrix;
|
|
m: TAffineMatrix;
|
|
begin
|
|
begin
|
|
@@ -661,12 +661,15 @@ begin
|
|
FXAxis - (FYAxis - FOrigin), FYAxis - (FXAxis - FOrigin));
|
|
FXAxis - (FYAxis - FOrigin), FYAxis - (FXAxis - FOrigin));
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TCustomRectShape.Transform(AMatrix: TAffineMatrix);
|
|
|
|
|
|
+procedure TCustomRectShape.Transform(const AMatrix: TAffineMatrix);
|
|
|
|
+var
|
|
|
|
+ m: TAffineMatrix;
|
|
begin
|
|
begin
|
|
BeginUpdate(TCustomRectShapeDiff);
|
|
BeginUpdate(TCustomRectShapeDiff);
|
|
- FOrigin := AMatrix*FOrigin;
|
|
|
|
- FXAxis := AMatrix*FXAxis;
|
|
|
|
- FYAxis := AMatrix*FYAxis;
|
|
|
|
|
|
+ m := MatrixForPixelCentered(AMatrix);
|
|
|
|
+ FOrigin := m*FOrigin;
|
|
|
|
+ FXAxis := m*FXAxis;
|
|
|
|
+ FYAxis := m*FYAxis;
|
|
inherited Transform(AMatrix);
|
|
inherited Transform(AMatrix);
|
|
EndUpdate;
|
|
EndUpdate;
|
|
end;
|
|
end;
|
|
@@ -812,7 +815,7 @@ begin
|
|
result := 1;
|
|
result := 1;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TRectShape.GetIsSlow(AMatrix: TAffineMatrix): boolean;
|
|
|
|
|
|
+function TRectShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean;
|
|
var
|
|
var
|
|
ab: TAffineBox;
|
|
ab: TAffineBox;
|
|
backSurface, totalSurface, penSurface: Single;
|
|
backSurface, totalSurface, penSurface: Single;
|
|
@@ -1188,7 +1191,7 @@ begin
|
|
result := false;
|
|
result := false;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TEllipseShape.GetIsSlow(AMatrix: TAffineMatrix): boolean;
|
|
|
|
|
|
+function TEllipseShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean;
|
|
var
|
|
var
|
|
ab: TAffineBox;
|
|
ab: TAffineBox;
|
|
backSurface, totalSurface, penSurface: Single;
|
|
backSurface, totalSurface, penSurface: Single;
|
|
@@ -1536,7 +1539,7 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TPhongShape.GetIsSlow(AMatrix: TAffineMatrix): boolean;
|
|
|
|
|
|
+function TPhongShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean;
|
|
var
|
|
var
|
|
ab: TAffineBox;
|
|
ab: TAffineBox;
|
|
begin
|
|
begin
|
|
@@ -1545,7 +1548,7 @@ begin
|
|
result := ab.Surface > 320*240;
|
|
result := ab.Surface > 320*240;
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TPhongShape.Transform(AMatrix: TAffineMatrix);
|
|
|
|
|
|
+procedure TPhongShape.Transform(const AMatrix: TAffineMatrix);
|
|
begin
|
|
begin
|
|
BeginUpdate(TPhongShapeDiff);
|
|
BeginUpdate(TPhongShapeDiff);
|
|
LightPosition := AMatrix*LightPosition;
|
|
LightPosition := AMatrix*LightPosition;
|