You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-22 22:17:48 +02:00
Fix wrong SELECT size with multiple SELECT elements in OSR mode
This commit is contained in:
@ -664,6 +664,7 @@ var
|
||||
TempForcedResize : boolean;
|
||||
TempBitmapData : TBitmapData;
|
||||
TempBitmap : TBitmap;
|
||||
TempSrcRect, TempDstRect : TRectF;
|
||||
begin
|
||||
try
|
||||
FResizeCS.Acquire;
|
||||
@ -768,7 +769,18 @@ begin
|
||||
end;
|
||||
|
||||
if FShowPopup and (FPopUpBitmap <> nil) then
|
||||
FMXBufferPanel1.BufferDraw(FPopUpRect.Left, FPopUpRect.Top, FPopUpBitmap);
|
||||
begin
|
||||
TempSrcRect := RectF(0, 0,
|
||||
min(FPopUpRect.Width, FPopUpBitmap.Width),
|
||||
min(FPopUpRect.Height, FPopUpBitmap.Height));
|
||||
|
||||
TempDstRect.Left := FPopUpRect.Left / GlobalCEFApp.DeviceScaleFactor;
|
||||
TempDstRect.Top := FPopUpRect.Top / GlobalCEFApp.DeviceScaleFactor;
|
||||
TempDstRect.Right := TempDstRect.Left + (TempSrcRect.Width / GlobalCEFApp.DeviceScaleFactor);
|
||||
TempDstRect.Bottom := TempDstRect.Top + (TempSrcRect.Height / GlobalCEFApp.DeviceScaleFactor);
|
||||
|
||||
FMXBufferPanel1.BufferDraw(FPopUpBitmap, TempSrcRect, TempDstRect);
|
||||
end;
|
||||
end;
|
||||
|
||||
if (type_ = PET_VIEW) then
|
||||
@ -805,10 +817,15 @@ end;
|
||||
procedure TBrowserFrame.FMXChromium1PopupSize(Sender: TObject;
|
||||
const browser: ICefBrowser; const rect: PCefRect);
|
||||
begin
|
||||
FPopUpRect.Left := rect.x;
|
||||
FPopUpRect.Top := rect.y;
|
||||
FPopUpRect.Right := rect.x + rect.width - 1;
|
||||
FPopUpRect.Bottom := rect.y + rect.height - 1;
|
||||
if (GlobalCEFApp <> nil) then
|
||||
begin
|
||||
LogicalToDevice(rect^, GlobalCEFApp.DeviceScaleFactor);
|
||||
|
||||
FPopUpRect.Left := rect.x;
|
||||
FPopUpRect.Top := rect.y;
|
||||
FPopUpRect.Right := rect.x + rect.width - 1;
|
||||
FPopUpRect.Bottom := rect.y + rect.height - 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.FMXChromium1StatusMessage(Sender: TObject;
|
||||
|
Reference in New Issue
Block a user