diff options
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_node.h | 5 | ||||
-rw-r--r-- | source/blender/editors/include/ED_transform.h | 1 | ||||
-rw-r--r-- | source/blender/editors/include/UI_resources.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/UI_view2d.h | 17 |
4 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 6e4002fcc0a..1d51a3e77cf 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -53,8 +53,9 @@ typedef enum { #define NODE_EDGE_PAN_INSIDE_PAD 2 #define NODE_EDGE_PAN_OUTSIDE_PAD 0 /* Disable clamping for node panning, use whole screen. */ #define NODE_EDGE_PAN_SPEED_RAMP 1 -#define NODE_EDGE_PAN_MAX_SPEED 40 /* In UI units per second, slower than default. */ -#define NODE_EDGE_PAN_DELAY 1.0f +#define NODE_EDGE_PAN_MAX_SPEED 26 /* In UI units per second, slower than default. */ +#define NODE_EDGE_PAN_DELAY 0.5f +#define NODE_EDGE_PAN_ZOOM_INFLUENCE 0.5f /* space_node.c */ diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index cb6fb0dba60..69ac48d842f 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -137,6 +137,7 @@ int BIF_countTransformOrientation(const struct bContext *C); #define P_GPENCIL_EDIT (1 << 13) #define P_CURSOR_EDIT (1 << 14) #define P_CLNOR_INVALIDATE (1 << 15) +#define P_VIEW2D_EDGE_PAN (1 << 16) /* For properties performed when confirming the transformation. */ #define P_POST_TRANSFORM (1 << 19) diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index c99c7f681b3..dde8a637e05 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -185,7 +185,7 @@ typedef enum ThemeColorID { TH_NODE_LAYOUT, TH_NODE_SHADER, TH_NODE_INTERFACE, - TH_NODE_CONVERTOR, + TH_NODE_CONVERTER, TH_NODE_GROUP, TH_NODE_FRAME, TH_NODE_MATTE, diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 4ee7df89487..e3c02b4c249 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -26,6 +26,7 @@ #pragma once #include "BLI_compiler_attrs.h" +#include "BLI_rect.h" #ifdef __cplusplus extern "C" { @@ -321,6 +322,14 @@ typedef struct View2DEdgePanData { float max_speed; /** Delay in seconds before maximum speed is reached. */ float delay; + /** Influence factor for view zoom: + * 0 = Constant speed in UI units + * 1 = Constant speed in view space, UI speed slows down when zooming out + */ + float zoom_influence; + + /** Initial view rect. */ + rctf initial_rect; /** Amount to move view relative to zoom. */ float facx, facy; @@ -338,7 +347,8 @@ void UI_view2d_edge_pan_init(struct bContext *C, float outside_pad, float speed_ramp, float max_speed, - float delay); + float delay, + float zoom_influence); void UI_view2d_edge_pan_reset(struct View2DEdgePanData *vpd); @@ -350,6 +360,8 @@ void UI_view2d_edge_pan_apply_event(struct bContext *C, struct View2DEdgePanData *vpd, const struct wmEvent *event); +void UI_view2d_edge_pan_cancel(struct bContext *C, struct View2DEdgePanData *vpd); + void UI_view2d_edge_pan_operator_properties(struct wmOperatorType *ot); void UI_view2d_edge_pan_operator_properties_ex(struct wmOperatorType *ot, @@ -357,7 +369,8 @@ void UI_view2d_edge_pan_operator_properties_ex(struct wmOperatorType *ot, float outside_pad, float speed_ramp, float max_speed, - float delay); + float delay, + float zoom_influence); /* Initialize panning data with operator settings. */ void UI_view2d_edge_pan_operator_init(struct bContext *C, |