X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgx%2Fgh_flexlay.pas;h=79c6a5c578b8fc3a858d34eb5cc966f8a4a691c7;hb=345e116f73d0e4b11593a94bee7d18b9e64572eb;hp=f9487028524e56367082f0211caa8a5805af6d98;hpb=fe568f37c781a2433440cd0033f557fd499d1e93;p=d2df-sdl.git diff --git a/src/gx/gh_flexlay.pas b/src/gx/gh_flexlay.pas index f948702..79c6a5c 100644 --- a/src/gx/gh_flexlay.pas +++ b/src/gx/gh_flexlay.pas @@ -502,6 +502,7 @@ var grp: PLayGroup; maxsz: Integer; cidx: LayControlIdx; + ct: PLayControl; mr: TLayMargins; begin // reset all 'laywrap' flags for controls, set initial 'startsize' @@ -527,15 +528,17 @@ begin for c := 0 to High(grp.ctls) do begin cidx := grp.ctls[c]; - if (maxsz < ctlist[cidx].startsize[gtype]) then maxsz := ctlist[cidx].startsize[gtype]; + ct := @ctlist[cidx]; + if (maxsz < ct.startsize[gtype]) then maxsz := ct.startsize[gtype]; end; for c := 0 to High(grp.ctls) do begin cidx := grp.ctls[c]; - if (maxsz <> ctlist[cidx].startsize[gtype]) then + ct := @ctlist[cidx]; + if (maxsz <> ct.startsize[gtype]) then begin needRecalcMaxSize := true; - ctlist[cidx].startsize[gtype] := maxsz; + ct.startsize[gtype] := maxsz; end; end; end; @@ -731,7 +734,7 @@ begin // expand or align if (lc.expand) then lc.desiredsize.w := nmin(lc.maxsize.w, me.desiredsize.w-me.margins.vert) // expand else if (lc.aligndir > 0) then lc.desiredpos.x := me.desiredsize.w-me.margins.right-lc.desiredsize.w // right align - else if (lc.aligndir = 0) then lc.desiredpos.x := (me.desiredsize.w-me.margins.horiz-lc.desiredsize.w) div 2; // center + else if (lc.aligndir = 0) then lc.desiredpos.x := (me.desiredsize.w-lc.desiredsize.w) div 2; // center if (not osz.equals(lc.desiredsize)) then begin if (lc.inGroup) then groupElementChanged := true; @@ -833,7 +836,7 @@ begin end; for c := 0 to 1 do begin - if (ct.maxsize[c] <= 0) then continue; + if (ct.maxsize[c] < 0) then continue; if (ct.desiredsize[c] > ct.maxsize[c]) then begin //writeln('ctl #', f, '; dimension #', c, ': desired=', ctlist[f].desiredsize[c], '; max=', ctlist[f].maxsize[c]);