aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/TextButton.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/TextButton.cc')
-rw-r--r--src/FbTk/TextButton.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc
index a472349..6d93c92 100644
--- a/src/FbTk/TextButton.cc
+++ b/src/FbTk/TextButton.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: TextButton.cc,v 1.5 2004/01/09 02:19:02 fluxgen Exp $ 22// $Id: TextButton.cc,v 1.6 2004/09/11 22:58:20 fluxgen Exp $
23 23
24#include "TextButton.hh" 24#include "TextButton.hh"
25#include "Font.hh" 25#include "Font.hh"
@@ -142,8 +142,11 @@ void TextButton::drawText(int x_offset, int y_offset) {
142 142
143 // center text by default 143 // center text by default
144 int center_pos = height()/2 + font().ascent()/2 - 1; 144 int center_pos = height()/2 + font().ascent()/2 - 1;
145 FbDrawable *drawable = &m_buffer;
146 if (backgroundPixmap() == ParentRelative)
147 drawable = this;
145 148
146 font().drawText(backgroundPixmap() == ParentRelative ? window() : m_buffer.drawable(), 149 font().drawText(*drawable,
147 screenNumber(), 150 screenNumber(),
148 gc(), // graphic context 151 gc(), // graphic context
149 text().c_str(), textlen, // string and string size 152 text().c_str(), textlen, // string and string size