From fed4b839217d9c2fb1fe3980640c4c1b056ed840 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 8 May 2007 02:40:07 +0000 Subject: [PATCH] SetFont fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wx/lib/floatcanvas/FloatCanvas.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/wxPython/wx/lib/floatcanvas/FloatCanvas.py b/wxPython/wx/lib/floatcanvas/FloatCanvas.py index 8a26656e8c..60d773a1d0 100644 --- a/wxPython/wx/lib/floatcanvas/FloatCanvas.py +++ b/wxPython/wx/lib/floatcanvas/FloatCanvas.py @@ -1555,8 +1555,8 @@ class ScaledTextBox(TextObjectMixin, DrawObject): DrawingSize = self.LayoutFontSize # pts This effectively determines the resolution that the BB is computed to. ScaleFactor = float(self.Size) / DrawingSize Width = (self.Width - 2*self.PadSize) / ScaleFactor #Width to wrap to - dc.SetFont(self.SetFont(DrawingSize, self.Family, self.Style, self.Weight, self.Underlined, self.FaceName) ) - + self.SetFont(DrawingSize, self.Family, self.Style, self.Weight, self.Underlined, self.FaceName) + dc.SetFont(self.Font) NewStrings = [] for s in self.Strings: #beginning = True @@ -1605,8 +1605,8 @@ class ScaledTextBox(TextObjectMixin, DrawObject): DrawingSize = self.LayoutFontSize # pts This effectively determines the resolution that the BB is computed to. ScaleFactor = float(self.Size) / DrawingSize - dc.SetFont(self.SetFont(DrawingSize, self.Family, self.Style, self.Weight, self.Underlined, self.FaceName) ) - + self.SetFont(DrawingSize, self.Family, self.Style, self.Weight, self.Underlined, self.FaceName) + dc.SetFont(self.Font) TextHeight = dc.GetTextExtent("X")[1] SpaceWidth = dc.GetTextExtent(" ")[0] LineHeight = TextHeight * self.LineSpacing @@ -1690,8 +1690,8 @@ class ScaledTextBox(TextObjectMixin, DrawObject): ## note that this limit is dependent on how much memory you have, etc. Size = min(Size, self.MaxFontSize) - font = self.SetFont(Size, self.Family, self.Style, self.Weight, self.Underlined, self.FaceName) - dc.SetFont(font) + self.SetFont(Size, self.Family, self.Style, self.Weight, self.Underlined, self.FaceName) + dc.SetFont(self.Font) dc.SetTextForeground(self.Color) dc.SetBackgroundMode(wx.TRANSPARENT) @@ -2468,7 +2468,9 @@ class FloatCanvas(wx.Panel): """ self._HTBitmap = wx.EmptyBitmap(self.PanelSize[0], + self.PanelSize[1], + depth=self.HitTestBitmapDepth) def MakeNewForegroundHTBitmap(self): @@ -2480,7 +2482,9 @@ class FloatCanvas(wx.Panel): """ self._ForegroundHTBitmap = wx.EmptyBitmap(self.PanelSize[0], + self.PanelSize[1], + depth=self.HitTestBitmapDepth) def OnSize(self, event=None):