Changeset 13041 for OpenSceneGraph/trunk/src/osgWidget/Input.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgWidget/Input.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgWidget/Input.cpp
r12292 r13041 104 104 _widths.resize(_text->getText().size()+1, 1.0f); 105 105 106 if (_text->getText().size()==0) 106 if (_text->getText().size()==0) 107 107 { 108 108 _offsets[0] = 0; … … 129 129 } 130 130 } 131 131 132 132 std::list<unsigned int> keys; 133 133 for (unsigned int i=0; i<_text->getText().size(); ++i) … … 249 249 else 250 250 { 251 // We're at the end of the string, perhaps the string is empty, 251 // We're at the end of the string, perhaps the string is empty, 252 252 // so get the advance for any character, perhaps a large one, I chose 'A'. 253 253 osgText::Glyph* glyph = const_cast<osgText::Font*>(_text->getFont())->getGlyph(osgText::FontResolution(_text->getFontWidth(), _text->getFontHeight()), 'A'); … … 298 298 i == _offsets.size() - 1) // If we're at the last one, obviously it will be there. 299 299 { 300 _selectionEndIndex = _index = i; 300 _selectionEndIndex = _index = i; 301 301 positioned(); 302 302 break; … … 311 311 double offset = getOrigin().x(); 312 312 Window* window = getParent(); 313 if (window) 314 { 315 offset += window->getOrigin().x(); 313 if (window) 314 { 315 offset += window->getOrigin().x(); 316 316 } 317 317 … … 326 326 i == _offsets.size() - 1) // If we're at the last one, obviously it will be there. 327 327 { 328 _selectionStartIndex = _selectionEndIndex = _index = i; 328 _selectionStartIndex = _selectionEndIndex = _index = i; 329 329 positioned(); 330 330 break;
