[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : alex
Repository : xara
Revision : 945
Date : Wed May 3 12:24:38 BST 2006
Changed paths:
M /Trunk/XaraLX/wxOil/osrndrgn.cpp
Change default font size for FixedSystemText
Diff:
Index: Trunk/XaraLX/wxOil/osrndrgn.cpp
===================================================================
--- Trunk/XaraLX/wxOil/osrndrgn.cpp (revision 944)
+++ Trunk/XaraLX/wxOil/osrndrgn.cpp (revision 945)
@@ -1162,8 +1162,8 @@
!EmptyPen // not on NULL pens (over complex)
)
{
-/// Windows version would have used brush calculation to set pen properties
-/// CalcLogBrush( &Brush, RR_STROKECOLOUR() );
+// Windows version would have used brush calculation to set pen properties
+// CalcLogBrush( &Brush, RR_STROKECOLOUR() );
INT32 PenWidth = MPtoLP(RR_LINEWIDTH());
if (IsPrinting())
@@ -2203,6 +2203,12 @@
wxString Text = (wxString)(TCHAR *)(*TheText);
wxRect Rect(0,0,0,0);
+ wxFont SaveFont=RenderDC->GetFont();
+
+ wxFont FixedFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
+ FixedFont.SetPointSize(8);
+ RenderDC->SetFont(FixedFont);
+
wxDC * pDC = RenderDC;
wxSize DPI = GetFixedDCPPI(*pDC);
INT32 XDPI = DPI.GetWidth();
@@ -2222,6 +2228,7 @@
{
ERROR3("Can not calculate text size");
BoundsRect = DocRect(0, 0, 0, 0);
+ RenderDC->SetFont(SaveFont);
return;
}
// For some reason, Rect.bottom and Rect.top seem to be incorrect, so we have
@@ -2229,6 +2236,7 @@
BoundsRect = DocRect(0, 0,
(INT32)(((double)Rect.width * IN_MP_VAL) / XDPI),
(INT32)(((double)LineHeight * IN_MP_VAL) / YDPI) );
+ RenderDC->SetFont(SaveFont);
return;
}
@@ -2259,7 +2267,7 @@
// Restore the brush. First we have to ensure SetBrush really works. This is
// because the GTK brush is corrupted whilst the wxWidgets one is still right.
// So we have to select a different brush or wxWidgets will skip the call
- // that would otherwise fix the GTK brush
+ // that would otherwise fix the GTK brush - wxWidgets bug #148096
RenderDC->SetBackgroundMode(SaveBackgroundMode);
RenderDC->SetBrush(*wxTRANSPARENT_BRUSH);
RenderDC->SetBrush(wxNullBrush);
@@ -2269,6 +2277,8 @@
// ENSURE(LineHeight > 0, "OSRenderRegion::DrawFixedSystemText failed");
}
+
+ RenderDC->SetFont(SaveFont);
}
Xara