Commit b987fdf8 authored by pwrd's avatar pwrd

Flow, zoom didn't redraw and work area rectangle wasn't displayed in gtk

parent 7ea6601f
......@@ -1002,6 +1002,9 @@ void FlowDrawGtk::set_dirty(void *wind) {
void FlowDrawGtk::rect(int x, int y, int width, int height,
flow_eDrawType gc_type, int fill, int idx, int highlight, int dimmed)
{
if (width == 0 || height == 0)
return;
GdkGC* gc;
if (gc_type == flow_eDrawType_Green) {
gc = gc_green;
......
......@@ -445,6 +445,7 @@ void FlowCtx::zoom(double factor)
= int((offset_y - window_height / 2.0 * (1.0 / factor - 1)) * factor);
a.zoom();
nav_zoom();
set_dirty();
change_scrollbar();
}
......@@ -788,6 +789,7 @@ void FlowCtx::nav_draw(int ll_x, int ll_y, int ur_x, int ur_y)
a.a[i]->nav_draw(ll_x, ll_y, ur_x, ur_y);
}
if ( window_width != 0 && window_height != 0) {
nav_rect_ll_x = int(nav_zoom_factor * offset_x / zoom_factor - nav_offset_x);
nav_rect_ur_x = int(
nav_zoom_factor * (offset_x + window_width) / zoom_factor - nav_offset_x);
......@@ -797,6 +799,7 @@ void FlowCtx::nav_draw(int ll_x, int ll_y, int ur_x, int ur_y)
fdraw->rect(nav_rect_ll_x, nav_rect_ll_y, nav_rect_ur_x - nav_rect_ll_x,
nav_rect_ur_y - nav_rect_ll_y, flow_eDrawType_Line, 0, 0);
}
}
void FlowCtx::find_grid(double x, double y, double* x_grid, double* y_grid)
......@@ -1233,10 +1236,12 @@ int FlowCtx::event_handler_nav(flow_eEvent event, int x, int y)
}
}
break;
case flow_eEvent_Exposure:
case flow_eEvent_Exposure: {
fdraw->get_window_size(navw, &nav_window_width, &nav_window_height);
fdraw->get_window_size(mw, &window_width, &window_height);
nav_zoom();
break;
}
case flow_eEvent_ButtonMotion:
if (nav_rect_movement_active) {
int delta_x = x - nav_rect_move_last_x;
......
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