anchor.diff:    tmpRect := ARect;
     if DrawText(ACanvas.Handle, PChar(AText), -1, tmpRect, TempFlags) = 0 then
       RaiseLastOSError;
  -  {$endif}
  +  {$ENDIF}
   end;
   
   
  
positive.code: 
    function ScaleForDPI (const aValue : integer) : integer;
  
    procedure WriteText(ACanvas: TCanvas; const ARect: TRect; const AText: string; ATextAlignment: TAlignment);
    {$ifdef fpc}
    function IsDoubleBufferedNeeded: boolean;
    {$endif}
  
    function CtrlPressed: boolean;
    function ShiftPressed: boolean;
  
negative.code:   HLSMAX = 255;
  {$ENDIF}
  
  {$IFDEF FPC}
  function IsDoubleBufferedNeeded: boolean;
  begin
    Result:= WidgetSet.GetLCLCapability(lcCanDrawOutsideOnPaint) = LCL_CAPABILITY_YES;
  end;
  {$ENDIF}
  
  function GetTextWidth(const aText: String; const aFont: TFont): Integer;
  var
    bmp: TBitmap;
  begin
    Result := 0;
    bmp := TBitmap.Create;
    try
      bmp.Canvas.Font.Assign(aFont);
      Result := bmp.Canvas.TextWidth(aText);
    finally
      bmp.Free;
    end;
  end;
  
  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}
    w, h : integer;
    lastSize : integer;
  begin
    SetBkMode(ACanvas.Handle, TRANSPARENT);
  
    lastSize := ACanvas.Font.Size;
  
    w := ACanvas.TextWidth(AText);
    h := ACanvas.TextHeight(AText);
    if (w > ARect.Width) or (h > Arect.Height) then
    begin
      while ((w > ARect.Width) or (h > Arect.Height)) and (aCanvas.Font.Size > 8) do
      begin
        ACanvas.Font.Size := ACanvas.Font.Size - 1;
        w := ACanvas.TextWidth(AText);
        h := ACanvas.TextHeight(AText);
      end;
    end
    else if (w < ARect.Width) and (h < ARect.Height) then
    begin
      while (w < ARect.Width) and (h < ARect.Height) do
      begin
        lastSize := ACanvas.Font.Size;
        ACanvas.Font.Size := ACanvas.Font.Size + 1;
        w := ACanvas.TextWidth(AText);
        h := ACanvas.TextHeight(AText);
      end;
      ACanvas.Font.Size:= lastSize;
    end;
    // ACanvas.Font.Size := min(max(8, (ARect.Bottom - ARect.Top) - 30), max(8, (ARect.Right - ARect.Left) - 24));
    {$IFNDEF WINDOWS}
    newText := AText;
    if (ARect.Width < ACanvas.TextWidth('..')) then
      exit;
  