Frame inverse and sensitive area adjusted

parent a3f601f2
......@@ -113,3 +113,29 @@ void FlowFrame::get_borders( double pos_x, double pos_y, double *x_right,
*y_high = pos_y + ur.y;
}
int FlowFrame::event_handler( void *pos, flow_eEvent event, int x, int y,
void *node)
{
FlowPoint *p;
p = (FlowPoint *) pos;
if ( ctx->type() == flow_eCtxType_Brow) {
if ( ll.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x <= x &&
ll.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y <= y &&
y <= ur.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y)
return 1;
else
return 0;
}
else {
if ( ll.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x <= x &&
x <= ur.z_x + ((FlowPoint *)pos)->z_x - ctx->offset_x &&
ll.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y <= y &&
y <= ur.z_y + ((FlowPoint *)pos)->z_y - ctx->offset_y)
// cout << "Event handler: Hit in rect" << endl;
return 1;
else
return 0;
}
}
......@@ -41,6 +41,8 @@ class FlowFrame : public FlowRect {
void get_borders( double pos_x, double pos_y, double *x_right,
double *x_left, double *y_high, double *y_low, void *node);
flow_eObjectType type() { return flow_eObjectType_Frame;};
int event_handler( void *pos, flow_eEvent event, int x, int y,
void *node);
};
#endif
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