mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 08:19:29 +02:00
* base lineheight on TextMetric instead of font height
git-svn-id: trunk@22538 -
This commit is contained in:
parent
4b3af617a2
commit
03d44b6c7a
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||||
ComCtrls, StdCtrls, Grids, ExtCtrls, LclType, DebuggerDlg, Debugger,
|
ComCtrls, StdCtrls, Grids, ExtCtrls, LclType, LCLIntf, DebuggerDlg, Debugger,
|
||||||
EditorOptions, Maps, Math;
|
EditorOptions, Maps, Math;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -87,14 +87,13 @@ end;
|
|||||||
|
|
||||||
constructor TAssemblerDlg.Create(AOwner: TComponent);
|
constructor TAssemblerDlg.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
FLineHeight := Abs(EditorOpts.EditorFontHeight) + EditorOpts.ExtraLineSpacing;
|
|
||||||
FGutterWidth := 32;
|
FGutterWidth := 32;
|
||||||
|
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
// DoubleBuffered := True;
|
// DoubleBuffered := True;
|
||||||
|
|
||||||
pbAsm.Font.Name := EditorOpts.EditorFont;
|
|
||||||
pbAsm.Font.Height := EditorOpts.EditorFontHeight;
|
pbAsm.Font.Height := EditorOpts.EditorFontHeight;
|
||||||
|
pbAsm.Font.Name := EditorOpts.EditorFont;
|
||||||
Caption := lisMenuViewAssembler;
|
Caption := lisMenuViewAssembler;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -145,18 +144,28 @@ begin
|
|||||||
sbHorizontal.PageSize := R.Right;
|
sbHorizontal.PageSize := R.Right;
|
||||||
sbHorizontal.LargeChange := R.Right div 3;
|
sbHorizontal.LargeChange := R.Right div 3;
|
||||||
|
|
||||||
FLineCount := R.Bottom div FLineHeight;
|
if FLineHeight <> 0
|
||||||
UpdateLineData(FTopLine + FLineCount);
|
then begin
|
||||||
|
FLineCount := R.Bottom div FLineHeight;
|
||||||
|
UpdateLineData(FTopLine + FLineCount);
|
||||||
|
end;
|
||||||
|
|
||||||
pbAsm.SetBounds(0, 0, R.Right, R.Bottom);
|
pbAsm.SetBounds(0, 0, R.Right, R.Bottom);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAssemblerDlg.InitializeWnd;
|
procedure TAssemblerDlg.InitializeWnd;
|
||||||
|
var
|
||||||
|
TM: TTextMetric;
|
||||||
begin
|
begin
|
||||||
inherited InitializeWnd;
|
inherited InitializeWnd;
|
||||||
|
|
||||||
FCharWidth := EditorOpts.ExtraCharSpacing + pbAsm.Canvas.TextExtent('X').cx;
|
GetTextMetrics(pbAsm.Canvas.Handle, TM);
|
||||||
|
FCharWidth := EditorOpts.ExtraCharSpacing + TM.tmMaxCharWidth;
|
||||||
sbHorizontal.SmallChange := FCHarWidth;
|
sbHorizontal.SmallChange := FCHarWidth;
|
||||||
|
|
||||||
|
FLineHeight := EditorOpts.ExtraLineSpacing + TM.tmHeight;
|
||||||
|
FLineCount := pbAsm.Height div FLineHeight;
|
||||||
|
UpdateLineData(FTopLine + FLineCount);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TAssemblerDlg.pbAsmMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
procedure TAssemblerDlg.pbAsmMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
Loading…
Reference in New Issue
Block a user