rildomoraes / dcef3

Automatically exported from code.google.com/p/dcef3
0 stars 0 forks source link

Update FMX Resizing #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Could you Update and optimize below codes to your lib?
It fix Resizing problem

procedure TCustomChromiumFMX.Resize;
var
  brws: ICefBrowser;
begin
  inherited;
  if not (csDesigning in ComponentState) then
  begin
    brws := FBrowser;
    if (brws <> nil) then
    begin
      brws.Host.WasResized;
      {if FBuffer <> nil then
        FBuffer.Free;
      FBuffer := TBitmap.Create(Trunc(Width), Trunc(Height));  }
      if FBuffer = nil then
        FBuffer := TBitmap.Create(Trunc(Width), Trunc(Height))
      else
      begin
        if (Trunc(Width) <> FBuffer.Width) or (Trunc(Height) <> FBuffer.Height) then
        begin
          FBuffer.Width := Trunc(Width);
          FBuffer.Height := Trunc(Height);
          Resize;     // khalid : after resizing, call again resize procedure to avoid the non fired onpaint event.
        end;
      end;
    end;
  end;
end;

Original issue reported on code.google.com by jo...@ryron.net on 14 Aug 2014 at 3:56

GoogleCodeExporter commented 9 years ago

Original comment by hgourv...@gmail.com on 1 Mar 2015 at 11:17