Commit 74c01b6e authored by Olivier Lagrasse's avatar Olivier Lagrasse

[Bug Fix]

- Fix bug when user clicks and releases click on the ruler or on the container area: the trace and other elements disappeared.

[Feature changement]
- When the trace is entirely displayed, do not draw the selection square in the minimap.

parent 19d7e686
......@@ -338,11 +338,29 @@ void Hook_event::mouseReleaseEvent(QMouseEvent * event){
return;/* escape */
}
/* Thin box in the ruler: ignore */
if (_mouse_pressed_inside_ruler &&
((_new_mouse_x-_mouse_x) < _minimum_distance_for_selection) ){
_mouse_pressed = false;
_mouse_pressed_inside_ruler = false;
return;
}
/* Thin box in the containers: ignore */
if (_mouse_pressed_inside_container &&
((_new_mouse_y-_mouse_y) < _minimum_distance_for_selection) ){
_mouse_pressed = false;
_mouse_pressed_inside_container = false;
return;
}
/*
* Now, user was drawing a box. Zoom in it!
*/
/* Now, register this position which will be used by a right clic */
/* Register this position which will be used by a right clic */
selection_stack_buf.x_scale = _x_state_scale;
selection_stack_buf.y_scale = _y_state_scale;
selection_stack_buf.x_translate = _x_state_translate;
......
......@@ -157,15 +157,23 @@ void Minimap::redraw(){
if (buf.isNull())
return;
_painter.begin(&buf);
_pen.setColor(Session::Minimap::pen_color);
_pen.setWidth(Session::Minimap::pen_size);
_painter.setPen(_pen);
_painter.setBrush(QBrush(Session::Minimap::brush_color));
_painter.drawRect ( _x, _y, _w, _h);/* Draw the viewport quad */
_painter.end();
/* If the viewport quad does not match the entire
minimap frame, draw it */
if (! ( _x == 0 &&
_y == 0 &&
_w == Session::Minimap::width &&
_h == Session::Minimap::height ) )
{
_painter.begin(&buf);
_pen.setColor(Session::Minimap::pen_color);
_pen.setWidth(Session::Minimap::pen_size);
_painter.setPen(_pen);
_painter.setBrush(QBrush(Session::Minimap::brush_color));
_painter.drawRect ( _x, _y, _w, _h);/* Draw the viewport quad */
_painter.end();
}
setPixmap(buf);
setScaledContents(true);
......
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