Ignore:
Timestamp:
Mar 18, 2021, 10:58:28 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Gamma was incorrectly applied to images with transparency colors.
  • Modified: Change Templates to GraphicSet so it can also have description of its items.
  • Modified: Use TextExtent instead of both TextWidth and TextHeight.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/ButtonA.pas

    r290 r315  
    44
    55uses
    6   ButtonBase, Classes, Graphics, LCLIntf, LCLType, ScreenTools;
     6  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      BitBltCanvas(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.