mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 01:49:28 +02:00
MG: speedbuttonglyph centered, buttonglyph border fixed
git-svn-id: trunk@312 -
This commit is contained in:
parent
38adf9cc3c
commit
12fdcee41e
@ -38,12 +38,13 @@ Function TButtonGlyph.Draw(Canvas: TCanvas; const Client: TRect;
|
||||
var
|
||||
gWidth : integer;
|
||||
gHeight : integer;
|
||||
DestRect: TRect;
|
||||
begin
|
||||
// for default assume only 1 glyph
|
||||
|
||||
gWidth := TPixMap(FOriginal).Width;
|
||||
gHeight := TPixMap(FOriginal).Height;
|
||||
Result := Rect(0, 0, gWidth - 1, gHeight - 1);
|
||||
Result := Rect(0, 0, gWidth, gHeight);
|
||||
|
||||
if NumGlyphs > 1 then
|
||||
begin
|
||||
@ -60,8 +61,13 @@ begin
|
||||
Result := Rect(0, 0, gWidth - 1, gHeight - 1);
|
||||
end;
|
||||
|
||||
DestRect:=Client;
|
||||
inc(DestRect.Left,Offset.X);
|
||||
inc(DestRect.Right,Offset.X);
|
||||
inc(DestRect.Top,Offset.Y);
|
||||
inc(DestRect.Bottom,Offset.Y);
|
||||
if not Transparent then
|
||||
Canvas.Copyrect(Client, TPixmap(FOriginal).Canvas, Result)
|
||||
Canvas.Copyrect(DestRect, TPixmap(FOriginal).Canvas, Result)
|
||||
else
|
||||
;
|
||||
end;
|
||||
|
@ -290,6 +290,10 @@ begin
|
||||
Offset.X := 0;
|
||||
Offset.Y := 0;
|
||||
end;
|
||||
inc(Offset.X,(PaintRect.Right-PaintRect.Left
|
||||
-TButtonGlyph(FGlyph).Glyph.Width) div 2);
|
||||
inc(Offset.Y,(PaintRect.Bottom-PaintRect.Top
|
||||
-TButtonGlyph(FGlyph).Glyph.Height) div 2);
|
||||
|
||||
//this needs to be done yet.
|
||||
Assert(False,'Trace:TODO: DRAWTEXTBIDIMODEFLAGS');
|
||||
@ -522,6 +526,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.9 2001/07/03 10:30:32 lazarus
|
||||
MG: speedbuttonglyph centered, buttonglyph border fixed
|
||||
|
||||
Revision 1.8 2001/06/14 14:57:58 lazarus
|
||||
MG: small bugfixes and less notes
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user