Changeset 15 for trunk/Packages


Ignore:
Timestamp:
Dec 27, 2017, 8:28:45 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Drawing of TWindow background.
  • Fixed: Initialize TGraphicObject canvas only once.
Location:
trunk/Packages/Kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Kernel/UAPI.pas

    r13 r15  
    252252  if Assigned(Window) then begin
    253253    Canvas := Window.Canvas;
    254     Canvas.Parent := TKernel(Kernel).Screens.First.Canvas;
    255254    Result := Canvas.Id;
    256255  end else Result := -1;
  • trunk/Packages/Kernel/UGraphics.pas

    r13 r15  
    7070    Id: Integer;
    7171    Visible: Boolean;
     72    constructor Create;
    7273    procedure Paint; virtual;
    7374    property Canvas: TCanvas read GetCanvas;
     
    102103    Objects: TFPGObjectList<TGraphicObject>;
    103104    Canvases: TFPGObjectList<TCanvas>;
     105    ParentCanvas: TCanvas;
    104106    function CreateWindow: TWindow;
    105107    function CreateCanvas: TCanvas;
     
    225227function TGraphicObject.GetCanvas: TCanvas;
    226228begin
    227   FCanvas := Desktop.CreateCanvas;
     229  if not Assigned(FCanvas) then
     230    FCanvas := Desktop.CreateCanvas;
    228231  Result := FCanvas;
     232end;
     233
     234constructor TGraphicObject.Create;
     235begin
     236  FCanvas := nil;
    229237end;
    230238
     
    257265  Result := TWindow.Create;
    258266  Result.Id := ObjectLastId;
     267  Result.Desktop := Self;
     268  Result.Canvas.Parent := ParentCanvas;
    259269  Objects.Add(Result);
     270  Paint;
    260271end;
    261272
  • trunk/Packages/Kernel/UKernel.pas

    r13 r15  
    8989      TScreenCanvas(NewScreen.Canvas).Screen := NewScreen;
    9090      Screens.Add(NewScreen);
     91      Desktop.ParentCanvas := Screens.First.Canvas;
    9192    end;
    9293    Modes.Free;
  • trunk/Packages/Kernel/UScreen.pas

    r13 r15  
    6868  for X := Rect.Left to Rect.Right do
    6969    SetPixel(TPoint.Create(X, Y), Color);
     70  Screen.VideoMemoryUpdated;
    7071end;
    7172
Note: See TracChangeset for help on using the changeset viewer.