utility functions for getting/setting rectangles for operators.
This commit is contained in:
@@ -1930,10 +1930,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
/* get settings from operator */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
|
||||
@@ -1146,14 +1146,13 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
|
||||
TimeMarker *marker;
|
||||
float xminf, xmaxf, yminf, ymaxf;
|
||||
int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
|
||||
int xmin = RNA_int_get(op->ptr, "xmin");
|
||||
int xmax = RNA_int_get(op->ptr, "xmax");
|
||||
int ymin = RNA_int_get(op->ptr, "ymin");
|
||||
int ymax = RNA_int_get(op->ptr, "ymax");
|
||||
int extend = RNA_boolean_get(op->ptr, "extend");
|
||||
rcti rect;
|
||||
|
||||
UI_view2d_region_to_view(v2d, xmin, ymin, &xminf, &yminf);
|
||||
UI_view2d_region_to_view(v2d, xmax, ymax, &xmaxf, &ymaxf);
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
UI_view2d_region_to_view(v2d, rect.xmin, rect.ymin, &xminf, &yminf);
|
||||
UI_view2d_region_to_view(v2d, rect.xmax, rect.ymax, &xmaxf, &ymaxf);
|
||||
|
||||
if (markers == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -185,15 +185,14 @@ static int previewrange_define_exec(bContext *C, wmOperator *op)
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
float sfra, efra;
|
||||
int xmin, xmax;
|
||||
rcti rect;
|
||||
|
||||
/* get min/max values from border select rect (already in region coordinates, not screen) */
|
||||
xmin = RNA_int_get(op->ptr, "xmin");
|
||||
xmax = RNA_int_get(op->ptr, "xmax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
/* convert min/max values to frames (i.e. region to 'tot' rect) */
|
||||
UI_view2d_region_to_view(&ar->v2d, xmin, 0, &sfra, NULL);
|
||||
UI_view2d_region_to_view(&ar->v2d, xmax, 0, &efra, NULL);
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmin, 0, &sfra, NULL);
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmax, 0, &efra, NULL);
|
||||
|
||||
/* set start/end frames for preview-range
|
||||
* - must clamp within allowable limits
|
||||
@@ -232,12 +231,11 @@ static void ANIM_OT_previewrange_set(wmOperatorType *ot)
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* rna */
|
||||
/* used to define frame range */
|
||||
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
|
||||
/* these are not used, but are needed by borderselect gesture operator stuff */
|
||||
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
|
||||
/* used to define frame range.
|
||||
*
|
||||
* note: border Y values are not used,
|
||||
* but are needed by borderselect gesture operator stuff */
|
||||
WM_operator_properties_border(ot);
|
||||
}
|
||||
|
||||
/* ****************** clear preview range operator ****************************/
|
||||
|
||||
@@ -1178,11 +1178,7 @@ static void VIEW2D_OT_zoom_border(wmOperatorType *ot)
|
||||
ot->poll = view_zoom_poll;
|
||||
|
||||
/* rna */
|
||||
RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
|
||||
WM_operator_properties_gesture_border(ot, FALSE);
|
||||
}
|
||||
|
||||
/* ********************************************************* */
|
||||
|
||||
@@ -414,10 +414,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
|
||||
int change = FALSE, mode, extend;
|
||||
|
||||
/* get rectangle from operator */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
ED_mask_point_pos(sa, ar, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
|
||||
ED_mask_point_pos(sa, ar, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
|
||||
|
||||
@@ -3262,11 +3262,7 @@ static void SCREEN_OT_border_select(wmOperatorType *ot)
|
||||
|
||||
/* rna */
|
||||
RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
|
||||
|
||||
WM_operator_properties_border(ot);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -398,8 +398,5 @@ void PAINT_OT_hide_show(struct wmOperatorType *ot)
|
||||
RNA_def_enum(ot->srna, "area", area_items, PARTIALVIS_INSIDE,
|
||||
"Area", "Which vertices to hide or show");
|
||||
|
||||
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
|
||||
WM_operator_properties_border(ot);
|
||||
}
|
||||
|
||||
@@ -294,10 +294,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
|
||||
deselect_action_keys(&ac, 1, SELECT_SUBTRACT);
|
||||
|
||||
/* get settings from operator */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
|
||||
if (gesture_mode == GESTURE_MODAL_SELECT)
|
||||
|
||||
@@ -353,10 +353,7 @@ static int border_select_graph_exec(bContext *C, wmOperator *op)
|
||||
rcti rect;
|
||||
|
||||
/* get rectangle from operator */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &userdata.rect.xmin, &userdata.rect.ymin);
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &userdata.rect.xmax, &userdata.rect.ymax);
|
||||
|
||||
@@ -348,10 +348,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
|
||||
int framenr = ED_space_clip_get_clip_frame_number(sc);
|
||||
|
||||
/* get rectangle from operator */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
ED_clip_point_stable_pos(sc, ar, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
|
||||
ED_clip_point_stable_pos(sc, ar, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
|
||||
|
||||
@@ -243,10 +243,7 @@ static int file_border_select_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
if (result == OPERATOR_RUNNING_MODAL) {
|
||||
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
BLI_rcti_isect(&(ar->v2d.mask), &rect, &rect);
|
||||
|
||||
@@ -277,10 +274,7 @@ static int file_border_select_exec(bContext *C, wmOperator *op)
|
||||
int extend = RNA_boolean_get(op->ptr, "extend");
|
||||
short select = (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
|
||||
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
if (!extend) {
|
||||
SpaceFile *sfile = CTX_wm_space_file(C);
|
||||
|
||||
@@ -316,10 +316,7 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op)
|
||||
incl_handles = RNA_boolean_get(op->ptr, "include_handles");
|
||||
|
||||
/* get settings from operator */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
/* selection 'mode' depends on whether borderselect region only matters on one axis */
|
||||
if (RNA_boolean_get(op->ptr, "axis_range")) {
|
||||
|
||||
@@ -231,10 +231,7 @@ static int borderselect_exec(bContext *C, wmOperator *op)
|
||||
short selecting = (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
|
||||
//int mval[2];
|
||||
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
#if 0
|
||||
mval[0] = rect.xmin;
|
||||
|
||||
@@ -295,10 +295,7 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op)
|
||||
deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_SUBTRACT);
|
||||
|
||||
/* get settings from operator */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
if (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT)
|
||||
selectmode = SELECT_ADD;
|
||||
|
||||
@@ -467,12 +467,9 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
|
||||
int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
|
||||
int extend = RNA_boolean_get(op->ptr, "extend");
|
||||
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
|
||||
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
|
||||
|
||||
for (node = snode->edittree->nodes.first; node; node = node->next) {
|
||||
|
||||
@@ -899,12 +899,9 @@ static int outliner_border_select_exec(bContext *C, wmOperator *op)
|
||||
rctf rectf;
|
||||
int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
|
||||
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
|
||||
|
||||
for (te = soops->tree.first; te; te = te->next) {
|
||||
|
||||
@@ -860,10 +860,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
|
||||
if (ed == NULL)
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
mval[0] = rect.xmin;
|
||||
mval[1] = rect.ymin;
|
||||
|
||||
@@ -2471,10 +2471,7 @@ static int render_border_exec(bContext *C, wmOperator *op)
|
||||
rctf vb;
|
||||
|
||||
/* get border select values using rna */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
/* calculate range */
|
||||
ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, &vb, FALSE);
|
||||
@@ -2528,10 +2525,7 @@ void VIEW3D_OT_render_border(wmOperatorType *ot)
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
/* rna */
|
||||
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
|
||||
WM_operator_properties_border(ot);
|
||||
|
||||
}
|
||||
/* ********************* Border Zoom operator ****************** */
|
||||
@@ -2562,10 +2556,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
/* get border select values using rna */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
/* check if zooming in/out view */
|
||||
gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
|
||||
@@ -2710,11 +2701,7 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot)
|
||||
ot->flag = 0;
|
||||
|
||||
/* rna */
|
||||
RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
|
||||
WM_operator_properties_gesture_border(ot, FALSE);
|
||||
}
|
||||
|
||||
/* sets the view to 1:1 camera/render-pixel */
|
||||
@@ -3325,10 +3312,7 @@ static int view3d_clipping_exec(bContext *C, wmOperator *op)
|
||||
bglMats mats;
|
||||
rcti rect;
|
||||
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
rv3d->rflag |= RV3D_CLIPPING;
|
||||
rv3d->clipbb = MEM_callocN(sizeof(BoundBox), "clipbb");
|
||||
@@ -3381,10 +3365,7 @@ void VIEW3D_OT_clip_border(wmOperatorType *ot)
|
||||
ot->flag = 0;
|
||||
|
||||
/* rna */
|
||||
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
|
||||
WM_operator_properties_border(ot);
|
||||
}
|
||||
|
||||
/* ***************** 3d cursor cursor op ******************* */
|
||||
|
||||
@@ -1938,10 +1938,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
|
||||
select = (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT);
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
|
||||
if (vc.obedit) {
|
||||
|
||||
@@ -2937,7 +2937,7 @@ int Resize(TransInfo *t, const int mval[2])
|
||||
/* vertices in the radius of the brush end */
|
||||
/* outside the clipping area */
|
||||
/* XXX HACK - dg */
|
||||
if(t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
clipUVData(t);
|
||||
}
|
||||
}
|
||||
@@ -3802,7 +3802,7 @@ int Translation(TransInfo *t, const int UNUSED(mval[2]))
|
||||
/* vertices in the radius of the brush end */
|
||||
/* outside the clipping area */
|
||||
/* XXX HACK - dg */
|
||||
if(t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
if (t->flag & (T_PROP_EDIT | T_PROP_CONNECTED)) {
|
||||
clipUVData(t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2453,10 +2453,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
|
||||
int change, pinned, select, faces, extend;
|
||||
|
||||
/* get rectangle from operator */
|
||||
rect.xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect.ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect.xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect.ymax = RNA_int_get(op->ptr, "ymax");
|
||||
WM_operator_properties_border_to_rcti(op, &rect);
|
||||
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmin, rect.ymin, &rectf.xmin, &rectf.ymin);
|
||||
UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax);
|
||||
|
||||
@@ -208,6 +208,8 @@ void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring
|
||||
void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot);
|
||||
void WM_operator_properties_free(struct PointerRNA *ptr);
|
||||
void WM_operator_properties_filesel(struct wmOperatorType *ot, int filter, short type, short action, short flag, short display);
|
||||
void WM_operator_properties_border(struct wmOperatorType *ot);
|
||||
void WM_operator_properties_border_to_rcti(struct wmOperator *op, struct rcti *rect);
|
||||
void WM_operator_properties_gesture_border(struct wmOperatorType *ot, int extend);
|
||||
void WM_operator_properties_mouse_select(struct wmOperatorType *ot);
|
||||
void WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, int cursor);
|
||||
|
||||
@@ -906,16 +906,31 @@ void WM_operator_properties_select_all(wmOperatorType *ot)
|
||||
RNA_def_enum(ot->srna, "action", select_all_actions, SEL_TOGGLE, "Action", "Selection action to execute");
|
||||
}
|
||||
|
||||
void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend)
|
||||
void WM_operator_properties_border(wmOperatorType *ot)
|
||||
{
|
||||
RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX);
|
||||
RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX);
|
||||
}
|
||||
|
||||
if (extend)
|
||||
void WM_operator_properties_border_to_rcti(struct wmOperator *op, rcti *rect)
|
||||
{
|
||||
rect->xmin = RNA_int_get(op->ptr, "xmin");
|
||||
rect->ymin = RNA_int_get(op->ptr, "ymin");
|
||||
rect->xmax = RNA_int_get(op->ptr, "xmax");
|
||||
rect->ymax = RNA_int_get(op->ptr, "ymax");
|
||||
}
|
||||
|
||||
void WM_operator_properties_gesture_border(wmOperatorType *ot, int extend)
|
||||
{
|
||||
RNA_def_int(ot->srna, "gesture_mode", 0, INT_MIN, INT_MAX, "Gesture Mode", "", INT_MIN, INT_MAX);
|
||||
|
||||
WM_operator_properties_border(ot);
|
||||
|
||||
if (extend) {
|
||||
RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection instead of deselecting everything first");
|
||||
}
|
||||
}
|
||||
|
||||
void WM_operator_properties_mouse_select(wmOperatorType *ot)
|
||||
|
||||
Reference in New Issue
Block a user