Ignore:
Timestamp:
Apr 17, 2019, 12:58:41 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Propagate project build mode options to used packages.
  • Added: Check memory leaks using heaptrc.
  • Modified: Update BGRABitmap package.
Location:
GraphicTest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest

    • Property svn:ignore
      •  

        old new  
        88GraphicTest.lps
        99GraphicTest.dbg
         10heaptrclog.trc
  • GraphicTest/Packages/bgrabitmap/bgracanvas.pas

    r494 r521  
    188188                         Filled: boolean = False;
    189189                         Continuous: boolean = False);
    190     procedure Draw(X,Y: Integer; SrcBitmap: TBGRACustomBitmap);
     190    procedure Draw(X,Y: Integer; SrcBitmap: TBGRACustomBitmap); overload;
     191    procedure Draw(X,Y: Integer; SrcBitmap: TBitmap); overload;
    191192    procedure CopyRect(X,Y: Integer; SrcBitmap: TBGRACustomBitmap; SrcRect: TRect);
    192193    procedure StretchDraw(DestRect: TRect; SrcBitmap: TBGRACustomBitmap; HorizFlip: Boolean = false; VertFlip: Boolean = false);
     
    420421begin
    421422  FCustomPenStyle := DuplicatePenStyle(AValue);
    422 
    423   if IsSolidPenStyle(AValue) then FPenStyle := psSolid else
    424   if IsClearPenStyle(AValue) then FPenStyle := psClear else
    425     FPenStyle := psPattern;
     423  FPenStyle:= BGRAToPenStyle(AValue);
    426424end;
    427425
    428426procedure TBGRAPen.SetPenStyle(const AValue: TPenStyle);
    429427begin
     428  if AValue = psPattern then exit;
    430429  Case AValue of
    431430  psSolid: FCustomPenStyle := SolidPenStyle;
     
    811810begin
    812811  if not ComputeEllipseC(x1,y1,x2,y2,cx,cy,rx,ry) then exit;
    813   angle1 := round(arctan2(-(sy-cy)/ry,(sx-cx)/rx)*65536/(2*Pi));
    814   angle2 := round(arctan2(-(ey-cy)/ry,(ex-cx)/rx)*65536/(2*Pi));
     812  angle1 := round(arctan2(-(sy-cy)/ry,(sx-cx)/rx)*65536/(2*Pi)) and 65535;
     813  angle2 := round(arctan2(-(ey-cy)/ry,(ex-cx)/rx)*65536/(2*Pi)) and 65535;
    815814  Arc65536(x1,y1,x2,y2,angle1, angle2, [aoClosePath,aoFillPath]);
    816815end;
     
    828827begin
    829828  if not ComputeEllipseC(x1,y1,x2,y2,cx,cy,rx,ry) then exit;
    830   angle1 := round(arctan2(-(sy-cy)/ry,(sx-cx)/rx)*65536/(2*Pi));
    831   angle2 := round(arctan2(-(ey-cy)/ry,(ex-cx)/rx)*65536/(2*Pi));
     829  angle1 := round(arctan2(-(sy-cy)/ry,(sx-cx)/rx)*65536/(2*Pi)) and 65535;
     830  angle2 := round(arctan2(-(ey-cy)/ry,(ex-cx)/rx)*65536/(2*Pi)) and 65535;
    832831  Arc65536(x1,y1,x2,y2,angle1, angle2, [aoPie,aoFillPath]);
    833832end;
     
    11211120    multi := TBGRAMultishapeFiller.Create;
    11221121    multi.Antialiasing := AntialiasingMode <> amOff;
    1123     with bounds do
    1124     begin
    1125       multi.AddPolygon([PointF(Left-0.5,Top-0.5),PointF(Right-0.5,Top-0.5),
    1126                         PointF(Right-0.5-width,Top-0.5+width),PointF(Left-0.5+width,Top-0.5+width),
    1127                         PointF(Left-0.5+width,Bottom-0.5-width),PointF(Left-0.5,Bottom-0.5)],color1);
    1128       multi.AddPolygon([PointF(Right-0.5,Bottom-0.5),PointF(Left-0.5,Bottom-0.5),
    1129                         PointF(Left-0.5+width,Bottom-0.5-width),PointF(Right-0.5-width,Bottom-0.5-width),
    1130                         PointF(Right-0.5-width,Top-0.5+width),PointF(Right-0.5,Top-0.5)],color2);
    1131     end;
     1122    multi.AddPolygon([PointF(bounds.Left-0.5,bounds.Top-0.5),PointF(bounds.Right-0.5,bounds.Top-0.5),
     1123                      PointF(bounds.Right-0.5-width,bounds.Top-0.5+width),PointF(bounds.Left-0.5+width,bounds.Top-0.5+width),
     1124                      PointF(bounds.Left-0.5+width,bounds.Bottom-0.5-width),PointF(bounds.Left-0.5,bounds.Bottom-0.5)],color1);
     1125    multi.AddPolygon([PointF(bounds.Right-0.5,bounds.Bottom-0.5),PointF(bounds.Left-0.5,bounds.Bottom-0.5),
     1126                      PointF(bounds.Left-0.5+width,bounds.Bottom-0.5-width),PointF(bounds.Right-0.5-width,bounds.Bottom-0.5-width),
     1127                      PointF(bounds.Right-0.5-width,bounds.Top-0.5+width),PointF(bounds.Right-0.5,bounds.Top-0.5)],color2);
    11321128    multi.Draw(FBitmap);
    11331129    multi.Free;
     
    14341430end;
    14351431
     1432procedure TBGRACanvas.Draw(X, Y: Integer; SrcBitmap: TBitmap);
     1433begin
     1434  FBitmap.PutImage(X,Y,SrcBitmap,dmDrawWithTransparency);
     1435end;
     1436
    14361437procedure TBGRACanvas.CopyRect(X, Y: Integer; SrcBitmap: TBGRACustomBitmap;
    14371438  SrcRect: TRect);
Note: See TracChangeset for help on using the changeset viewer.