mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 19:39:18 +02:00
Cocoa: Fix code assumption that target is always TScrollingWinControl
This commit is contained in:
parent
62fddfd5f2
commit
83940629e2
@ -1086,18 +1086,20 @@ begin
|
|||||||
|
|
||||||
inherited setFrame(aframe);
|
inherited setFrame(aframe);
|
||||||
|
|
||||||
lclControl:= TScrollingWinControl(lclGetTarget);
|
if lclGetTarget is TScrollingWinControl then begin
|
||||||
newDocSize:= contentSize;
|
lclControl:= TScrollingWinControl(lclGetTarget);
|
||||||
|
newDocSize:= contentSize;
|
||||||
|
|
||||||
lclBar:= lclControl.HorzScrollBar;
|
lclBar:= lclControl.HorzScrollBar;
|
||||||
if lclBar.Visible and (lclBar.Range<>0) and (lclBar.Range>lclBar.Page) then
|
if lclBar.Visible and (lclBar.Range<>0) and (lclBar.Range>lclBar.Page) then
|
||||||
newDocSize.Width:= lclBar.Range;
|
newDocSize.Width:= lclBar.Range;
|
||||||
|
|
||||||
lclBar:= lclControl.VertScrollBar;
|
lclBar:= lclControl.VertScrollBar;
|
||||||
if lclBar.Visible and (lclBar.Range<>0) and (lclBar.Range>lclBar.Page) then
|
if lclBar.Visible and (lclBar.Range<>0) and (lclBar.Range>lclBar.Page) then
|
||||||
newDocSize.Height:= lclBar.Range;
|
newDocSize.Height:= lclBar.Range;
|
||||||
|
|
||||||
documentView.setFrameSize(newDocSize);
|
documentView.setFrameSize(newDocSize);
|
||||||
|
end;
|
||||||
|
|
||||||
if lclHorzScrollInfo.fMask<>0 then
|
if lclHorzScrollInfo.fMask<>0 then
|
||||||
applyScrollInfo(SB_Horz, lclHorzScrollInfo);
|
applyScrollInfo(SB_Horz, lclHorzScrollInfo);
|
||||||
|
Loading…
Reference in New Issue
Block a user