Commit bb009882 authored by Jule Marcoueille's avatar Jule Marcoueille

Correction bug sur le scroll aves les fleches de la barre de scroll.

parent fc6eb559
......@@ -91,6 +91,7 @@ Render_opengl::Render_opengl(Interface_console* core, QWidget *parent)
_new_mouse_x = 0;
_new_mouse_y = 0;
_mouse_pressed = false;
_key_scrolling = false;
_minimum_distance_for_selection = 5;/* 5 pixels */
......@@ -711,6 +712,7 @@ void Render_opengl::keyPressEvent(QKeyEvent * event) {
break;
}
_key_scrolling = true;
event->accept();/* accept the event */
}
......@@ -813,7 +815,10 @@ void Render_opengl::replace_translate(Element_pos new_translate){
_state_translate = new_translate;
// cerr << "-> _state_translate = " << _state_translate << " | " << _render_width*_state_scale << endl;
refresh_scroll_bars();
if (_key_scrolling){
refresh_scroll_bars();
_key_scrolling = false;
}
updateGL();
}
......@@ -828,7 +833,10 @@ void Render_opengl::replace_translate_y(Element_pos new_translate){
_y_state_translate = new_translate;
// cerr << "-> _y_state_translate = " << _y_state_translate << " | " << _render_height*_y_state_scale << endl;
refresh_scroll_bars();
if (_key_scrolling){
refresh_scroll_bars();
_key_scrolling = false;
}
updateGL();
}
......
......@@ -142,6 +142,11 @@ protected:
*/
int _new_mouse_y;
/*!
* \brief Indicate if the scroll was asked by key capture in openGL render area.
*/
bool _key_scrolling;
/*!
* \brief Alpha color of the selection rectangle.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment