瀏覽代碼

fixed compile fpc 3.2.2

mattias 2 周之前
父節點
當前提交
c2c5e95903
共有 1 個文件被更改,包括 16 次插入4 次删除
  1. 16 4
      src/base/fresnel.textlayouter.pas

+ 16 - 4
src/base/fresnel.textlayouter.pas

@@ -23,6 +23,13 @@ Type
   {$ELSE}
   TTextString = UnicodeString;
   TFontNameString = UnicodeString;
+  {$ENDIF}
+  {$IF FPC_FULLVERSION<=30301}
+  RTLString = string;
+  TSizeF = record
+    X, Y: single;
+  end;
+
   {$ENDIF}
 
   ETextLayout = Class(Exception);
@@ -642,7 +649,8 @@ end;
 
 function TTextLayoutBounds.GetAsPoint: TTextPoint;
 begin
-  Result:=PointF(Width,Height);
+  Result.x:=Width;
+  Result.y:=Height;
 end;
 
 procedure TTextLayoutBounds.SetAsPoint(AValue: TTextPoint);
@@ -692,7 +700,7 @@ end;
 
 function TTextLayoutBounds.ToString: RTLString;
 begin
-  Result:=ClassName+': '+AsPoint.ToString
+  Result:=ClassName+': '+FloatToStr(Width)+','+FloatToStr(Height);
 end;
 
 { TTextSplitter }
@@ -1646,12 +1654,16 @@ end;
 
 function TTextLayouter.GetTotalSize: TSizeF;
 begin
-  Result:=TSizeF.Create(GetTotalWidth,GetTotalHeight);
+  Result.X:=GetTotalWidth;
+  Result.Y:=GetTotalHeight;
 end;
 
 function TTextLayouter.GetBoundsRect: TRectF;
 begin
-  Result:=TRectF.Create(GetMinLeft,GetMinTop,GetMaxRight,GetMaxBottom);
+  Result.Left:=GetMinLeft;
+  Result.Top:=GetMinTop;
+  Result.Right:=GetMaxRight;
+  Result.Bottom:=GetMaxBottom;
 end;
 
 procedure TTextLayouter.ApplyStretchMode(const ADesiredHeight: TTextUnits);