mitsuba-renderer / nanogui

Minimalistic C++/Python GUI library for OpenGL, GLES2/3, Metal, and WebAssembly/WebGL
Other
1.52k stars 189 forks source link

Multiple small improvements #160

Open mkupchik opened 4 months ago

mkupchik commented 4 months ago

TextArea::draw() checks there's a selected area before drawing highlighted background. However, there's a duplicate condition m_selection_end != Vector2i(-1) in this check, presumably due to a typo. Let's do this check properly, using the same rules as in TextArea::keyboard_event().

As TextArea::m_selectable field is a bool, it makes sense for TextArea::is_selectable() and TextArea::set_selectable() methods to return and accept bool.

Also it's enough to clear m_tab_offsets once in TabWidgetBase::perform_layout().