diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llui/llbutton.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llui/llbutton.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 34e62c8..2c2c1c2 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -187,7 +188,7 @@ LLButton::LLButton(const std::string& name, const LLRect& rect, | |||
187 | 188 | ||
188 | void LLButton::init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name) | 189 | void LLButton::init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const std::string& control_name) |
189 | { | 190 | { |
190 | mGLFont = ( font ? font : LLFontGL::sSansSerif); | 191 | mGLFont = ( font ? font : LLFontGL::getFontSansSerif()); |
191 | 192 | ||
192 | // Hack to make sure there is space for at least one character | 193 | // Hack to make sure there is space for at least one character |
193 | if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(std::string(" "))) | 194 | if (getRect().getWidth() - (mRightHPad + mLeftHPad) < mGLFont->getWidth(std::string(" "))) |
@@ -422,13 +423,7 @@ void LLButton::draw() | |||
422 | // Unselected image assignments | 423 | // Unselected image assignments |
423 | S32 local_mouse_x; | 424 | S32 local_mouse_x; |
424 | S32 local_mouse_y; | 425 | S32 local_mouse_y; |
425 | LLCoordWindow cursor_pos_window; | 426 | LLUI::getCursorPositionLocal(this, &local_mouse_x, &local_mouse_y); |
426 | getWindow()->getCursorPosition(&cursor_pos_window); | ||
427 | LLCoordGL cursor_pos_gl; | ||
428 | getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl); | ||
429 | cursor_pos_gl.mX = llround((F32)cursor_pos_gl.mX / LLUI::sGLScaleFactor.mV[VX]); | ||
430 | cursor_pos_gl.mY = llround((F32)cursor_pos_gl.mY / LLUI::sGLScaleFactor.mV[VY]); | ||
431 | screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &local_mouse_x, &local_mouse_y); | ||
432 | 427 | ||
433 | BOOL pressed = pressed_by_keyboard | 428 | BOOL pressed = pressed_by_keyboard |
434 | || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) | 429 | || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) |