104
104
# Reset the translation and zoom, then draw the text at an offset
105
105
# based on the text width. There is a minor gotcha for supporting
106
106
# multiple platforms here, Translate and DrawText behave differently
108
108
# It would be nice is a cross platform library actually worked the
109
109
# same across platforms...
111
111
text_width = dc.GetTextExtent(label_text)[0]
112
112
text_x = (best_size.width - text_width)/2.0
113
113
text_y = self.button.factory.height
114
114
gc.Scale(100/float(self.zoom_x), 100/float(self.zoom_y))
116
116
if sys.platform == 'darwin':
117
117
gc.Translate(-x_offset + text_x, -y_offset + text_y)
118
118
dc.DrawText(label_text, 0, 0)
120
120
gc.Translate(-x_offset, -y_offset)
121
121
dc.DrawText(label_text, text_x, text_y)
123
123
if not self.button.enabled:
124
124
self._draw_disable_mask(gc)