IDE: fixed crash when componentpalette width too small

git-svn-id: trunk@13174 -
This commit is contained in:
mattias 2007-12-05 22:35:37 +00:00
parent b60ad6ee51
commit 31ca6d4fa8

View File

@ -442,6 +442,7 @@ begin
ButtonX:= ((ComponentPaletteBtnWidth*3) div 2) + 2;
MaxBtnPerRow:=((Page.ClientWidth - ButtonX) div ComponentPaletteBtnWidth);
if MaxBtnPerRow<1 then MaxBtnPerRow:=1;
Rows:=((ButtonCount-1) div MaxBtnPerRow)+1;
//DebugLn(['TComponentPalette.ReAlignButtons ',DbgSName(Page),' PageIndex=',Page.PageIndex,' ClientRect=',dbgs(Page.ClientRect)]);
// automatically set optimal row count and re-position controls to use height optimally