Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/ED_view3d.h4
-rw-r--r--source/blender/editors/interface/view2d.c3
-rw-r--r--source/blender/editors/screen/screen_ops.c71
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c34
4 files changed, 79 insertions, 33 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index eab770e2dad..85daa97343d 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -290,8 +290,8 @@ Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);
void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar, short do_clip);
int ED_view3d_lock(struct RegionView3D *rv3d);
-unsigned int ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
-unsigned int ED_viewedit_datamask(struct bScreen *screen);
+uint64_t ED_view3d_datamask(struct Scene *scene, struct View3D *v3d);
+uint64_t ED_viewedit_datamask(struct bScreen *screen);
/* camera lock functions */
int ED_view3d_camera_lock_check(struct View3D *v3d, struct RegionView3D *rv3d);
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index c2c482b0a2c..57d46de9cb7 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -177,7 +177,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */
switch (type) {
- /* 'standard view' - optimum setup for 'standard' view behaviour, that should be used new views as basis for their
+ /* 'standard view' - optimum setup for 'standard' view behaviour,
+ * that should be used new views as basis for their
* own unique View2D settings, which should be used instead of this in most cases...
*/
case V2D_COMMONVIEW_STANDARD:
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 2f80c58a836..de67a702598 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -1664,6 +1664,47 @@ static int region_scale_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_FINISHED;
}
+static int region_scale_get_maxsize(RegionMoveData *rmd)
+{
+ int maxsize= 0;
+
+ if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT) {
+ return rmd->sa->winx - UI_UNIT_X;
+ }
+
+ if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) {
+ /* this calculation seems overly verbose
+ * can someone explain why this method is necessary? - campbell */
+ maxsize = rmd->maxsize - ((rmd->sa->headertype==HEADERTOP)?UI_UNIT_Y*2:UI_UNIT_Y) - (UI_UNIT_Y/4);
+ }
+
+ return maxsize;
+}
+
+static void region_scale_validate_size(RegionMoveData *rmd)
+{
+ if((rmd->ar->flag & RGN_FLAG_HIDDEN)==0) {
+ short *size, maxsize= -1;
+
+
+ if(rmd->edge==AE_LEFT_TO_TOPRIGHT || rmd->edge==AE_RIGHT_TO_TOPLEFT)
+ size= &rmd->ar->sizex;
+ else
+ size= &rmd->ar->sizey;
+
+ maxsize= region_scale_get_maxsize(rmd);
+
+ if(*size > maxsize && maxsize > 0)
+ *size= maxsize;
+ }
+}
+
+static void region_scale_toggle_hidden(bContext *C, RegionMoveData *rmd)
+{
+ ED_region_toggle_hidden(C, rmd->ar);
+ region_scale_validate_size(rmd);
+}
+
static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
{
RegionMoveData *rmd= op->customdata;
@@ -1683,35 +1724,31 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
if(rmd->ar->sizex < UI_UNIT_X) {
rmd->ar->sizex= rmd->origval;
if(!(rmd->ar->flag & RGN_FLAG_HIDDEN))
- ED_region_toggle_hidden(C, rmd->ar);
+ region_scale_toggle_hidden(C, rmd);
}
else if(rmd->ar->flag & RGN_FLAG_HIDDEN)
- ED_region_toggle_hidden(C, rmd->ar);
+ region_scale_toggle_hidden(C, rmd);
}
else {
- int maxsize=0;
+ int maxsize= region_scale_get_maxsize(rmd);
delta= event->y - rmd->origy;
if(rmd->edge==AE_BOTTOM_TO_TOPLEFT) delta= -delta;
rmd->ar->sizey= rmd->origval + delta;
CLAMP(rmd->ar->sizey, 0, rmd->maxsize);
- if(rmd->ar->regiontype == RGN_TYPE_TOOL_PROPS) {
- /* this calculation seems overly verbose
- * can someone explain why this method is necessary? - campbell */
- maxsize = rmd->maxsize - ((rmd->sa->headertype==HEADERTOP)?UI_UNIT_Y*2:UI_UNIT_Y) - (UI_UNIT_Y/4);
- }
-
/* note, 'UI_UNIT_Y/4' means you need to drag the header almost
* all the way down for it to become hidden, this is done
* otherwise its too easy to do this by accident */
- if(rmd->ar->sizey < UI_UNIT_Y/4 || (maxsize > 0 && (rmd->ar->sizey > maxsize)) ) {
+ if(rmd->ar->sizey < UI_UNIT_Y/4) {
rmd->ar->sizey= rmd->origval;
if(!(rmd->ar->flag & RGN_FLAG_HIDDEN))
- ED_region_toggle_hidden(C, rmd->ar);
+ region_scale_toggle_hidden(C, rmd);
}
+ else if(maxsize > 0 && (rmd->ar->sizey > maxsize))
+ rmd->ar->sizey= maxsize;
else if(rmd->ar->flag & RGN_FLAG_HIDDEN)
- ED_region_toggle_hidden(C, rmd->ar);
+ region_scale_toggle_hidden(C, rmd);
}
ED_area_tag_redraw(rmd->sa);
WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
@@ -1723,10 +1760,14 @@ static int region_scale_modal(bContext *C, wmOperator *op, wmEvent *event)
if(ABS(event->x - rmd->origx) < 2 && ABS(event->y - rmd->origy) < 2) {
if(rmd->ar->flag & RGN_FLAG_HIDDEN) {
- ED_region_toggle_hidden(C, rmd->ar);
- ED_area_tag_redraw(rmd->sa);
- WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
+ region_scale_toggle_hidden(C, rmd);
+ }
+ else if(rmd->ar->flag & RGN_FLAG_TOO_SMALL) {
+ region_scale_validate_size(rmd);
}
+
+ ED_area_tag_redraw(rmd->sa);
+ WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
}
MEM_freeN(op->customdata);
op->customdata = NULL;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 0e65383861b..7cff37e8814 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -123,19 +123,19 @@ static int same_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
{
MTex* mtex = &brush->mtex;
- return
- (mtex->tex &&
- mtex->ofs[0] == snap->ofs[0] &&
- mtex->ofs[1] == snap->ofs[1] &&
- mtex->ofs[2] == snap->ofs[2] &&
- mtex->size[0] == snap->size[0] &&
- mtex->size[1] == snap->size[1] &&
- mtex->size[2] == snap->size[2] &&
- mtex->rot == snap->rot) &&
- ((mtex->brush_map_mode == MTEX_MAP_MODE_FIXED && brush_size(brush) <= snap->brush_size) || (brush_size(brush) == snap->brush_size)) && // make brush smaller shouldn't cause a resample
- mtex->brush_map_mode == snap->brush_map_mode &&
- vc->ar->winx == snap->winx &&
- vc->ar->winy == snap->winy;
+ return ( (mtex->tex) &&
+ equals_v3v3(mtex->ofs, snap->ofs) &&
+ equals_v3v3(mtex->size, snap->size) &&
+ mtex->rot == snap->rot
+ ) &&
+
+ /* make brush smaller shouldn't cause a resample */
+ ( (mtex->brush_map_mode == MTEX_MAP_MODE_FIXED && (brush_size(brush) <= snap->brush_size)) ||
+ (brush_size(brush) == snap->brush_size)) &&
+
+ (mtex->brush_map_mode == snap->brush_map_mode) &&
+ (vc->ar->winx == snap->winx) &&
+ (vc->ar->winy == snap->winy);
}
static void make_snap(Snapshot* snap, Brush* brush, ViewContext* vc)
@@ -869,7 +869,10 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
MEM_freeN(stroke);
return OPERATOR_FINISHED;
}
- else if(first || ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE) || (event->type == TIMER && (event->customdata == stroke->timer))) {
+ else if( (first) ||
+ (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) ||
+ (event->type == TIMER && (event->customdata == stroke->timer)) )
+ {
if(stroke->stroke_started) {
if(paint_smooth_stroke(stroke, mouse, event)) {
if(paint_space_stroke_enabled(stroke->brush)) {
@@ -887,7 +890,8 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event)
}
}
- /* we want the stroke to have the first daub at the start location instead of waiting till we have moved the space distance */
+ /* we want the stroke to have the first daub at the start location
+ * instead of waiting till we have moved the space distance */
if(first &&
stroke->stroke_started &&
paint_space_stroke_enabled(stroke->brush) &&