Ignore:
Timestamp:
Apr 6, 2021, 8:11:02 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Merged trunk branch version r348 into highdpi branch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/ButtonA.pas

    r303 r349  
    44
    55uses
    6   UDpiControls, ButtonBase, Classes, Graphics, LCLIntf, LCLType, ScreenTools;
     6  UDpiControls, ButtonBase, Classes, Graphics, LCLIntf, LCLType, ScreenTools, Types;
    77
    88type
     
    4141
    4242procedure TButtonA.Paint;
     43var
     44  TextSize: TSize;
    4345begin
    4446  with Canvas do
    45     if FGraphic <> nil then
    46     begin
     47    if FGraphic <> nil then begin
    4748      DpiBitCanvas(Canvas, 0, 0, 100, 25, Graphic.Canvas, 195,
    4849        243 + 26 * Byte(Down));
    4950      Canvas.Brush.Style := bsClear;
    50       Textout(50 - (TextWidth(FCaption) + 1) div 2, 12 - textheight(FCaption)
    51         div 2, FCaption);
    52     end
    53     else
    54     begin
     51      TextSize := TextExtent(FCaption);
     52      TextOut(50 - (TextSize.Width + 1) div 2,
     53        12 - TextSize.Height div 2, FCaption);
     54    end else begin
    5555      Brush.Color := $0000FF;
    5656      FrameRect(Rect(0, 0, 100, 25))
Note: See TracChangeset for help on using the changeset viewer.