anchor.diff:  interface
   
   uses
  -  {$IFDEF WINDOWS}Windows,{$ELSE} LCLIntf, LCLType,{$ENDIF} Forms, Controls, Graphics, Types, Classes;
  +  {$IFDEF WINDOWS}Windows,{$ELSE} {$ifdef fpc}InterfaceBase, LCLIntf, LCLType,{$endif}{$ENDIF} Forms, Controls, Graphics, Types, Classes;
   
   type
     TRectangleSide = (rsCenter, rsTop, rsLeft, rsBottom, rsRight, rsOutside);
  
positive.code:   function ScaleForDPI (const aValue : integer) : integer;
  
    procedure WriteText(ACanvas: TCanvas; const ARect: TRect; const AText: string; ATextAlignment: TAlignment);
  
  implementation
  
  
negative.code:   HLSMAX = 255;
  {$ENDIF}
  
  {$ifdef fpc}
  function IsDoubleBufferedNeeded: boolean;
  begin
    Result:= WidgetSet.GetLCLCapability(lcCanDrawOutsideOnPaint) = LCL_CAPABILITY_YES;
  end;
  {$endif}
  
  
  procedure WriteText(ACanvas: TCanvas; const ARect: TRect; const AText: string; ATextAlignment: TAlignment);
  var
    {$ifndef windows}
    xPos, tw, len1, len2 : integer;
    newText : string;
  
    {$else}
    TempFlags: cardinal;
    tmpRect : TRect;
    {$endif}
  begin
    SetBkMode(ACanvas.Handle, TRANSPARENT);
    ACanvas.Font.Size := min(max(8, (ARect.Bottom - ARect.Top) - 12), max(8, (ARect.Right - ARect.Left) - 24));
    {$ifndef windows}
    newText := AText;
    if (ARect.Width < ACanvas.TextWidth('..')) then
      exit;
    tw := ACanvas.TextWidth(newText);
    if tw > (ARect.Right - ARect.Left) then
    begin
      len1 := Length(AText);
      if len1 = 2 then
          newText := Copy(newText, 1, 1) + '.'
      else if len1 > 2 then
      begin
        while tw > (ARect.Right - ARect.Left) do
        begin
          len2 := Length(newText);
          newText := Copy(newText, 1, len2 - 3) + '..';
          if newText = '..' then
          begin
            newText := Copy(AText, 1, 1) + '.';
            break;
          end;
          tw := ACanvas.TextWidth(newText);
        end;
      end;
    end;
    case ATextAlignment of
      taLeftJustify: xPos := ARect.Left;
  