38 if (region ==
nullptr) {
118 const double current_time)
120 if (pan_dir_x == 0) {
126 if (pan_dir_y == 0) {
143 return x *
x *
x * (
x * (
x * 6.0 - 15.0) + 10.0);
149 const double current_time)
158 if (event_loc >
max) {
161 else if (event_loc <
min) {
169 CLAMP(distance_factor, 0.0f, 1.0f);
173 const float delay_factor = vpd->
delay > 0.01f ?
180 const float zoom_factor = 1.0f + std::clamp(vpd->
zoom_influence, 0.0f, 1.0f) * (zoomx - 1.0f);
182 return distance_factor * delay_factor * zoom_factor * vpd->
max_speed *
U.widget_unit *
207 if (dx != 0.0f || dy != 0.0f) {
225 rcti inside_rect, outside_rect;
226 inside_rect = region->
winrct;
227 outside_rect = region->
winrct;
245 if (xy[0] > inside_rect.
xmax && cur->
xmax < limit->
xmax) {
248 else if (xy[0] < inside_rect.
xmin && cur->
xmin > limit->
xmin) {
251 if (xy[1] > inside_rect.
ymax && cur->
ymax < limit->
ymax) {
254 else if (xy[1] < inside_rect.
ymin && cur->
ymin > limit->
ymin) {
264 float dx = 0.0f, dy = 0.0f;
265 if (pan_dir_x != 0) {
267 dx = dtime * speed *
float(pan_dir_x);
269 if (pan_dir_y != 0) {
271 dy = dtime * speed *
float(pan_dir_y);
328 float zoom_influence)
337 "Inside distance in UI units from the edge of the region within which to start panning",
347 "Outside distance in UI units from the edge of the region at which to stop panning",
356 "Width of the zone in UI units where speed increases with distance from the edge",
365 "Maximum speed in UI units per second",
374 "Delay in seconds before maximum speed is reached",
383 "Influence of the zoom factor on scroll speed",
Platform independent time functions.
int pad[32 - sizeof(int)]
#define BLI_assert_msg(a, msg)
float distance(float, float) RET
static void edge_pan_apply_delta(bContext *C, View2DEdgePanData *vpd, float dx, float dy)
void view2d_edge_pan_apply(bContext *C, View2DEdgePanData *vpd, const int xy[2]) ATTR_NONNULL(1
void view2d_edge_pan_operator_properties_ex(wmOperatorType *ot, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
void view2d_edge_pan_operator_init(bContext *C, View2DEdgePanData *vpd, wmOperator *op)
static void edge_pan_manage_delay_timers(View2DEdgePanData *vpd, int pan_dir_x, int pan_dir_y, const double current_time)
void view2d_edge_pan_cancel(bContext *C, View2DEdgePanData *vpd)
static float smootherstep(const float domain_max, float x)
void view2d_edge_pan_reset(View2DEdgePanData *vpd)
static float view2d_edge_pan_speed(View2DEdgePanData *vpd, int event_loc, bool x_dir, const double current_time)
void view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
void view2d_curRect_changed(const bContext *C, View2D *v2d)
void view2d_edge_pan_set_limits(View2DEdgePanData *vpd, float xmin, float xmax, float ymin, float ymax)
void view2d_edge_pan_init(bContext *C, View2DEdgePanData *vpd, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
void void view2d_edge_pan_apply_event(bContext *C, View2DEdgePanData *vpd, const wmEvent *event)
void view2d_edge_pan_operator_properties(wmOperatorType *ot)
bool view2d_edge_pan_poll(bContext *C)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
double BLI_time_now_seconds()
bScreen * CTX_wm_screen(const bContext *C)
bool BLI_rcti_isect_pt_v(const struct rcti *rect, const int xy[2])
void BLI_rcti_pad(struct rcti *rect, int pad_x, int pad_y)
void WM_event_add_mousemove(wmWindow *win)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
ARegion * CTX_wm_region(const bContext *C)
void ED_region_tag_redraw_no_rebuild(ARegion *region)
float RNA_float_get(PointerRNA *ptr, const char *name)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
MINLINE float clamp_f(float value, float min, float max)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
double edge_pan_start_time_y
double edge_pan_last_time
double edge_pan_start_time_x