在lazarus使用fr时发现memo如果有空格可能出现换行的问题。
修改方法:
打开frxGraphicUtils.pas文件,查找以下代码:
while i <= n do begin if (frxGetSymbol(s, i) = ' ') then if (FHandler.AllowTags) and (FHandler.Count > 0) then begin if (not FHandler[FHandler.Count - 1].Items[i - LineBegin].DontWRAP) then LastSpace := i; end else LastSpace := i; if FTempArray[i - 1 + addI] - Offset > FirstLineWidth then // need wrap begin
改为:
while i <= n do begin if (frxGetSymbol(s, i) = ' ') and (FWordBreak) then if (FHandler.AllowTags) and (FHandler.Count > 0) then begin if (not FHandler[FHandler.Count - 1].Items[i - LineBegin].DontWRAP) then LastSpace := i; end else LastSpace := i; if FTempArray[i - 1 + addI] - Offset > FirstLineWidth then // need wrap begin
重新编译就可以