Blender  V3.3
view2d_edge_pan.cc File Reference
#include "BKE_context.h"
#include "BLI_math.h"
#include "BLI_rect.h"
#include "ED_screen.h"
#include "MEM_guardedalloc.h"
#include "PIL_time.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "UI_interface.h"
#include "UI_view2d.h"
#include "WM_api.h"
#include "WM_types.h"

Go to the source code of this file.

Functions

Edge Pan Operator Utilities
bool UI_view2d_edge_pan_poll (bContext *C)
 
void UI_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 UI_view2d_edge_pan_set_limits (View2DEdgePanData *vpd, float xmin, float xmax, float ymin, float ymax)
 
void UI_view2d_edge_pan_reset (View2DEdgePanData *vpd)
 
static void edge_pan_manage_delay_timers (View2DEdgePanData *vpd, int pan_dir_x, int pan_dir_y, const double current_time)
 
static float smootherstep (const float domain_max, float x)
 
static float edge_pan_speed (View2DEdgePanData *vpd, int event_loc, bool x_dir, const double current_time)
 
static void edge_pan_apply_delta (bContext *C, View2DEdgePanData *vpd, float dx, float dy)
 
void UI_view2d_edge_pan_apply (bContext *C, View2DEdgePanData *vpd, const int xy[2])
 
void UI_view2d_edge_pan_apply_event (bContext *C, View2DEdgePanData *vpd, const wmEvent *event)
 
void UI_view2d_edge_pan_cancel (bContext *C, View2DEdgePanData *vpd)
 
void UI_view2d_edge_pan_operator_properties (wmOperatorType *ot)
 
void UI_view2d_edge_pan_operator_properties_ex (struct wmOperatorType *ot, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
 
void UI_view2d_edge_pan_operator_init (bContext *C, View2DEdgePanData *vpd, wmOperator *op)
 

Function Documentation

◆ edge_pan_apply_delta()

static void edge_pan_apply_delta ( bContext C,
View2DEdgePanData vpd,
float  dx,
float  dy 
)
static

◆ edge_pan_manage_delay_timers()

static void edge_pan_manage_delay_timers ( View2DEdgePanData vpd,
int  pan_dir_x,
int  pan_dir_y,
const double  current_time 
)
static

Reset the edge pan timers if the mouse isn't in the scroll zone and start the timers when the mouse enters a scroll zone.

Definition at line 109 of file view2d_edge_pan.cc.

References View2DEdgePanData::edge_pan_start_time_x, and View2DEdgePanData::edge_pan_start_time_y.

Referenced by UI_view2d_edge_pan_apply().

◆ edge_pan_speed()

static float edge_pan_speed ( View2DEdgePanData vpd,
int  event_loc,
bool  x_dir,
const double  current_time 
)
static

◆ smootherstep()

static float smootherstep ( const float  domain_max,
float  x 
)
static

Used to calculate a "fade in" factor for edge panning to make the interaction feel smooth and more purposeful.

Note
Assumes a domain_min of 0.0f.

Definition at line 134 of file view2d_edge_pan.cc.

References clamp_f(), and x.

Referenced by edge_pan_speed().

◆ UI_view2d_edge_pan_apply()

void UI_view2d_edge_pan_apply ( bContext C,
View2DEdgePanData vpd,
const int  xy[2] 
)

◆ UI_view2d_edge_pan_apply_event()

void UI_view2d_edge_pan_apply_event ( bContext C,
View2DEdgePanData vpd,
const wmEvent event 
)

Definition at line 273 of file view2d_edge_pan.cc.

References C, MOUSEMOVE, wmEvent::type, UI_view2d_edge_pan_apply(), and wmEvent::xy.

◆ UI_view2d_edge_pan_cancel()

void UI_view2d_edge_pan_cancel ( bContext C,
View2DEdgePanData vpd 
)

◆ UI_view2d_edge_pan_init()

void UI_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 
)

◆ UI_view2d_edge_pan_operator_init()

void UI_view2d_edge_pan_operator_init ( struct bContext C,
struct View2DEdgePanData vpd,
struct wmOperator op 
)

Initialize panning data with operator settings.

Definition at line 382 of file view2d_edge_pan.cc.

References C, wmOperator::ptr, RNA_float_get(), and UI_view2d_edge_pan_init().

Referenced by blender::ed::space_node::node_link_invoke(), and view_edge_pan_invoke().

◆ UI_view2d_edge_pan_operator_properties()

void UI_view2d_edge_pan_operator_properties ( wmOperatorType ot)

Definition at line 304 of file view2d_edge_pan.cc.

References ot, and UI_view2d_edge_pan_operator_properties_ex().

Referenced by VIEW2D_OT_edge_pan().

◆ UI_view2d_edge_pan_operator_properties_ex()

void UI_view2d_edge_pan_operator_properties_ex ( struct wmOperatorType ot,
float  inside_pad,
float  outside_pad,
float  speed_ramp,
float  max_speed,
float  delay,
float  zoom_influence 
)

◆ UI_view2d_edge_pan_poll()

bool UI_view2d_edge_pan_poll ( bContext C)

◆ UI_view2d_edge_pan_reset()

void UI_view2d_edge_pan_reset ( View2DEdgePanData vpd)

◆ UI_view2d_edge_pan_set_limits()

void UI_view2d_edge_pan_set_limits ( struct View2DEdgePanData vpd,
float  xmin,
float  xmax,
float  ymin,
float  ymax 
)

Set area which can be panned

Definition at line 91 of file view2d_edge_pan.cc.

References BLI_rctf_init(), and View2DEdgePanData::limit.

Referenced by createTransSeqData().