tvplanit: Fix text size growing in successive calls to TVpExCanvas.DrawRotatedText under gtk2.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4888 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-01 21:22:34 +00:00
parent d1c3eed2fa
commit 73cdbbf8b1
3 changed files with 6 additions and 6 deletions

View File

@ -58,10 +58,7 @@ object MainForm: TMainForm
KBNavigation = True KBNavigation = True
DateLabelFormat = 'mmmm yyyy' DateLabelFormat = 'mmmm yyyy'
DayHeadAttributes.Color = clBtnFace DayHeadAttributes.Color = clBtnFace
DayHeadAttributes.Font.Height = -13
DayHeadAttributes.Font.Name = 'Tahoma'
DayNameStyle = dsShort DayNameStyle = dsShort
DayNumberFont.Style = [fsBold]
DrawingStyle = dsFlat DrawingStyle = dsFlat
EventDayStyle = [fsItalic] EventDayStyle = [fsItalic]
LineColor = clGray LineColor = clGray

View File

@ -721,6 +721,7 @@ var
OldFont: TFont; OldFont: TFont;
RealPoint: TPoint; RealPoint: TPoint;
OldBrushStyle: TBrushStyle; OldBrushStyle: TBrushStyle;
savedFontHeight: Integer;
begin begin
if not Assigned(FCanvas) then if not Assigned(FCanvas) then
raise EVpCanvasError.Create(RSNoCanvas); raise EVpCanvasError.Create(RSNoCanvas);
@ -758,6 +759,7 @@ begin
// Create new font to use // Create new font to use
OldFont := FCanvas.Font; OldFont := FCanvas.Font;
try try
savedFontHeight := FCanvas.Font.Height;
FCanvas.Font.Handle:= CreateFontIndirect(LF); FCanvas.Font.Handle:= CreateFontIndirect(LF);
// Output the text // Output the text
@ -774,6 +776,7 @@ begin
end; end;
finally finally
FCanvas.Font := OldFont; FCanvas.Font := OldFont;
FCanvas.Font.Height := savedFontHeight;
end; end;
end; end;

View File

@ -349,9 +349,9 @@ begin
mvVisibleEvents := 0; mvVisibleEvents := 0;
{ set up fonts and colors } { set up fonts and colors }
FDayHeadAttributes.Font.Name := 'Tahoma'; // FDayHeadAttributes.Font.Name := 'Tahoma'; wp: better use defaults
FDayHeadAttributes.Font.Size := 10; // FDayHeadAttributes.Font.Size := 10;
FDayHeadAttributes.Font.Style := []; // FDayHeadAttributes.Font.Style := [];
FDayHeadAttributes.Color := clBtnFace; FDayHeadAttributes.Color := clBtnFace;
{ Assign default font to DayNumberFont and EventFont } { Assign default font to DayNumberFont and EventFont }