Blender
V3.3
|
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstring>
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#include "BLI_array.h"
#include "BLI_easing.h"
#include "BLI_link_utils.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_memarena.h"
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_timecode.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_screen.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "WM_api.h"
#include "BLF_api.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_view2d.h"
#include "interface_intern.h"
Go to the source code of this file.
Classes | |
struct | View2DScrollers |
struct | View2DString |
View2D Text Drawing Cache | |
static MemArena * | g_v2d_strings_arena = nullptr |
static View2DString * | g_v2d_strings = nullptr |
void | UI_view2d_text_cache_add (View2D *v2d, float x, float y, const char *str, size_t str_len, const uchar col[4]) |
void | UI_view2d_text_cache_add_rectf (View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const uchar col[4]) |
void | UI_view2d_text_cache_draw (ARegion *region) |
BLI_INLINE int clamp_float_to_int | ( | const float | f | ) |
Definition at line 54 of file view2d.cc.
References float(), max, min, and UNLIKELY.
Referenced by clamp_rctf_to_rcti(), and UI_view2d_view_to_region().
BLI_INLINE void clamp_rctf_to_rcti | ( | rcti * | dst, |
const rctf * | src | ||
) |
use instead of BLI_rcti_rctf_copy so we have consistent behavior with users of clamp_float_to_int.
Definition at line 72 of file view2d.cc.
References clamp_float_to_int(), src, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by UI_view2d_view_to_region_rcti(), and UI_view2d_view_to_region_rcti_clip().
Definition at line 846 of file view2d.cc.
References blender::compositor::area(), ELEM, SPACE_ACTION, SPACE_CLIP, SPACE_GRAPH, SPACE_NLA, and SPACE_SEQ.
Referenced by UI_view2d_sync().
Simple functions for consistent center offset access. Used by node editor to shift view center for each individual node tree.
Definition at line 1936 of file view2d.cc.
References BLI_rctf_cent_x(), BLI_rctf_cent_y(), and View2D::cur.
Referenced by actkeys_viewall(), nlaedit_viewall(), and blender::ed::space_node::node_draw_space().
Definition at line 1946 of file view2d.cc.
References BLI_rctf_recenter(), View2D::cur, UI_view2d_curRect_validate(), x, and y.
Referenced by actkeys_viewall(), nlaedit_viewall(), blender::ed::space_node::node_area_listener(), and blender::ed::space_node::snode_setup_v2d().
Definition at line 833 of file view2d.cc.
References C, CTX_wm_region(), ARegionType::on_view2d_changed, ARegion::type, and UI_view2d_curRect_validate().
Restore 'cur' rect to standard orientation (i.e. optimal maximum view of tot). This does not take into account if zooming the view on an axis will improve the view (if allowed).
Definition at line 914 of file view2d.cc.
References View2D::align, BLI_rcti_size_x(), BLI_rcti_size_y(), View2D::cur, float(), height, View2D::mask, V2D_ALIGN_NO_NEG_X, V2D_ALIGN_NO_NEG_Y, V2D_ALIGN_NO_POS_X, V2D_ALIGN_NO_POS_Y, width, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Definition at line 828 of file view2d.cc.
References ui_view2d_curRect_validate_resize().
Referenced by file_ensure_inside_viewbounds(), region_scale_toggle_hidden(), sequencer_draw_preview(), UI_view2d_center_set(), UI_view2d_curRect_changed(), and UI_view2d_offset().
Ensure View2D rects remain in a viable configuration 'cur' is not allowed to be: larger than max, smaller than min, or outside of 'tot'
Definition at line 383 of file view2d.cc.
References View2D::align, BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), CLAMP, View2D::cur, KDL::diff(), fabsf, float(), height, View2D::keepofs, View2D::keeptot, View2D::keepzoom, View2D::mask, View2D::max, View2D::maxzoom, View2D::min, View2D::minzoom, View2D::oldwinx, View2D::oldwiny, View2D::tot, V2D_ALIGN_NO_NEG_X, V2D_ALIGN_NO_NEG_Y, V2D_ALIGN_NO_POS_X, V2D_ALIGN_NO_POS_Y, V2D_KEEPASPECT, V2D_KEEPOFS_X, V2D_KEEPOFS_Y, V2D_KEEPTOT_STRICT, V2D_KEEPZOOM, V2D_LIMITZOOM, V2D_LOCKOFS_X, V2D_LOCKOFS_Y, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, view2d_masks(), width, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by UI_view2d_curRect_validate(), UI_view2d_region_reinit(), and UI_view2d_totRect_set_resize().
void UI_view2d_dot_grid_draw | ( | const View2D * | v2d, |
const int | grid_color_id, | ||
const float | min_step, | ||
const int | grid_subdivisions | ||
) |
Definition at line 1273 of file view2d.cc.
References BLI_assert, BLI_rctf_size_x(), BLI_rcti_size_x(), ceilf, clamp_f(), color, View2D::cur, float(), fractf(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_point_size(), GPU_PRIM_POINTS, GPU_SHADER_2D_FLAT_COLOR, GPU_vertformat_attr_add(), grid_axis_start_and_count(), immAttr4fv(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex2f(), immVertexFormat(), logf, View2D::mask, pos, pow2f(), powf, UI_DPI_FAC, UI_GetThemeColor3fv(), x, rctf::xmax, rctf::xmin, y, rctf::ymax, and rctf::ymin.
Definition at line 1852 of file view2d.cc.
References blender::compositor::area(), C, CTX_wm_area(), CTX_wm_region(), and ARegion::v2d.
Definition at line 1866 of file view2d.cc.
References blender::compositor::area(), BKE_area_find_region_type(), C, CTX_wm_area(), CTX_wm_region(), ARegion::regiontype, RGN_TYPE_WINDOW, and ARegion::v2d.
void UI_view2d_listview_view_to_cell | ( | float | columnwidth, |
float | rowheight, | ||
float | startx, | ||
float | starty, | ||
float | viewx, | ||
float | viewy, | ||
int * | r_column, | ||
int * | r_row | ||
) |
Get the 'cell' (row, column) that the given 2D-view coordinates (i.e. in 'tot' rect space) lie in.
columnwidth,rowheight | size of each 'cell' |
startx,starty | coordinates (in 'tot' rect space) that the list starts from. This should be (0,0) for most views. However, for those where the starting row was offsetted (like for Animation Editor channel lists, to make the first entry more visible), these will be the min-coordinates of the first item. |
viewx,viewy | 2D-coordinates (in 2D-view / 'tot' rect space) to get the cell for |
r_column,r_row | The 'coordinates' of the relevant 'cell'. |
Definition at line 1619 of file view2d.cc.
References floorf.
Referenced by actkeys_find_list_element_at_position(), animchannels_channel_get(), animchannels_mouseclick_invoke(), nlachannels_mouseclick_invoke(), and nlaedit_strip_at_region_position().
Definition at line 107 of file view2d.cc.
References View2D::winx, View2D::winy, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by view2d_masks().
Definition at line 2033 of file view2d.cc.
References UI_view2d_mouse_in_scrollers_ex(), and xy.
char UI_view2d_mouse_in_scrollers_ex | ( | const ARegion * | region, |
const View2D * | v2d, | ||
const int | xy[2], | ||
int * | r_scroll | ||
) |
Definition at line 1977 of file view2d.cc.
References IN_2D_HORIZ_SCROLL, IN_2D_VERT_SCROLL, View2D::scroll, V2D_SCROLL_HORIZONTAL, V2D_SCROLL_VERTICAL, view2d_scroll_mapped(), ARegion::winrct, rcti::xmin, xy, and rcti::ymin.
Referenced by UI_view2d_mouse_in_scrollers().
void UI_view2d_multi_grid_draw | ( | const View2D * | v2d, |
int | colorid, | ||
float | step, | ||
int | level_size, | ||
int | totlevels | ||
) |
Definition at line 1166 of file view2d.cc.
References color, View2D::cur, GPU_COMP_F32, GPU_COMP_U8, GPU_FETCH_FLOAT, GPU_FETCH_INT_TO_FLOAT_UNIT, GPU_line_width(), GPU_PRIM_LINES, GPU_SHADER_2D_FLAT_COLOR, GPU_vertformat_attr_add(), immAttr3ubv(), immAttrSkip(), immBeginAtMost(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex2f(), immVertexFormat(), offset, pos, TH_GRID, UI_GetThemeColorBlendShade3ubv(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Simple pan function (0.0, 0.0) bottom left (0.5, 0.5) center (1.0, 1.0) top right.
Definition at line 1954 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), View2D::cur, View2D::tot, UI_view2d_curRect_validate(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by ui_handle_panel_header(), and ui_handler_panel_region().
Definition at line 2039 of file view2d.cc.
References UI_view2d_rect_in_scrollers_ex().
char UI_view2d_rect_in_scrollers_ex | ( | const ARegion * | region, |
const View2D * | v2d, | ||
const rcti * | rect, | ||
int * | r_scroll | ||
) |
Definition at line 2006 of file view2d.cc.
References BLI_rcti_translate(), IN_2D_HORIZ_SCROLL_RECT, IN_2D_VERT_SCROLL_RECT, View2D::scroll, V2D_SCROLL_HORIZONTAL, V2D_SCROLL_VERTICAL, view2d_scroll_mapped(), ARegion::winrct, rcti::xmin, and rcti::ymin.
Referenced by UI_view2d_rect_in_scrollers().
Refresh and validation (of view rects).
Initialize all relevant View2D data (including view rects if first time) and/or refresh mask sizes after view resize.
Definition at line 217 of file view2d.cc.
References View2D::align, View2D::alpha_hor, View2D::alpha_vert, View2D::cur, View2D::flag, float(), View2D::keepofs, View2D::keeptot, View2D::keepzoom, View2D::max, View2D::maxzoom, View2D::min, View2D::minzoom, uiStyle::panelzoom, View2D::scroll, View2D::tot, type, UI_style_get(), ui_view2d_curRect_validate_resize(), UI_view2d_totRect_set_resize(), V2D_ALIGN_NO_NEG_X, V2D_ALIGN_NO_NEG_Y, V2D_ALIGN_NO_POS_Y, V2D_COMMONVIEW_HEADER, V2D_COMMONVIEW_LIST, V2D_COMMONVIEW_PANELS_UI, V2D_COMMONVIEW_STACK, V2D_COMMONVIEW_STANDARD, V2D_IS_INIT, V2D_KEEPASPECT, V2D_KEEPTOT_BOUNDS, V2D_KEEPTOT_STRICT, V2D_KEEPZOOM, V2D_LIMITZOOM, V2D_LOCKOFS_Y, V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, V2D_SCROLL_HORIZONTAL_HIDE, V2D_SCROLL_VERTICAL_HIDE, view2d_masks(), View2D::winx, View2D::winy, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_channel_region_init(), action_main_region_init(), clip_channels_region_init(), clip_preview_region_init(), console_main_region_init(), ED_region_header_init(), ED_region_panels_init(), file_main_region_draw(), file_main_region_init(), graph_channel_region_init(), graph_main_region_init(), hud_region_layout(), info_main_region_init(), nla_channel_region_init(), nla_main_region_init(), blender::ed::space_node::node_main_region_init(), outliner_main_region_init(), script_main_region_init(), sequencer_channel_region_init(), sequencer_main_region_init(), sequencer_preview_region_init(), spreadsheet_main_region_init(), text_main_region_init(), and topbar_main_region_init().
void UI_view2d_region_to_view | ( | const View2D * | v2d, |
float | x, | ||
float | y, | ||
float * | r_view_x, | ||
float * | r_view_y | ||
) |
Definition at line 1666 of file view2d.cc.
References UI_view2d_region_to_view_x(), UI_view2d_region_to_view_y(), x, and y.
Definition at line 1673 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), View2D::cur, float(), View2D::mask, rctf::xmax, rcti::xmin, rctf::xmin, rctf::ymax, rcti::ymin, and rctf::ymin.
Definition at line 1655 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rcti_size_x(), View2D::cur, View2D::mask, x, rcti::xmin, and rctf::xmin.
Referenced by actkeys_find_key_in_list_element(), actkeys_select_leftright_invoke(), draw_horizontal_scale_indicators(), ed_marker_select(), ED_region_overlap_isect_x(), ED_region_overlap_isect_x_with_margin(), frame_from_event(), graphkeys_select_leftright_invoke(), nlaedit_select_leftright_invoke(), nlaedit_strip_at_region_position(), previewrange_define_exec(), region_position_is_over_marker(), seq_snap_threshold_get_frame_distance(), sequencer_select_side_of_frame(), and UI_view2d_region_to_view().
Definition at line 1660 of file view2d.cc.
References BLI_rctf_size_y(), BLI_rcti_size_y(), View2D::cur, View2D::mask, y, rcti::ymin, and rctf::ymin.
Referenced by draw_cache_view(), draw_cache_view_iter_fn(), draw_vertical_scale_indicators(), ED_region_overlap_isect_y(), ED_region_overlap_isect_y_with_margin(), outliner_item_drag_element_find(), sequencer_rename_channel_invoke(), and UI_view2d_region_to_view().
Definition at line 1909 of file view2d.cc.
References UI_view2d_scale_get_x(), and UI_view2d_scale_get_y().
Definition at line 1926 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), View2D::cur, and View2D::mask.
Definition at line 1918 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rcti_size_x(), View2D::cur, and View2D::mask.
Referenced by UI_view2d_scale_get().
Definition at line 1922 of file view2d.cc.
References BLI_rctf_size_y(), BLI_rcti_size_y(), View2D::cur, and View2D::mask.
Referenced by UI_view2d_scale_get().
Definition at line 1884 of file view2d.cc.
References View2D::alpha_hor, View2D::alpha_vert, View2D::scroll, V2D_SCROLL_HANDLE_HEIGHT, V2D_SCROLL_HANDLE_WIDTH, V2D_SCROLL_HEIGHT, V2D_SCROLL_HORIZONTAL, V2D_SCROLL_HORIZONTAL_HANDLES, V2D_SCROLL_MIN_WIDTH, V2D_SCROLL_VERTICAL, V2D_SCROLL_VERTICAL_HANDLES, V2D_SCROLL_WIDTH, and view2d_scroll_mapped().
Referenced by view2d_masks().
void UI_view2d_scrollers_calc | ( | View2D * | v2d, |
const rcti * | mask_custom, | ||
struct View2DScrollers * | r_scrollers | ||
) |
Definition at line 1389 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), CLAMP, CLAMP_MAX, View2D::cur, float(), View2DScrollers::hor, View2D::hor, View2DScrollers::hor_max, View2DScrollers::hor_min, View2D::scroll, View2D::tot, UI_HEADER_OFFSET, V2D_SCROLL_BOTTOM, V2D_SCROLL_HANDLE_SIZE_HOTSPOT, V2D_SCROLL_HORIZONTAL, V2D_SCROLL_LEFT, V2D_SCROLL_THUMB_SIZE_MIN, V2D_SCROLL_VERTICAL, View2DScrollers::vert, View2D::vert, View2DScrollers::vert_max, View2DScrollers::vert_min, view2d_masks(), view2d_scroll_mapped(), rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, and rctf::ymin.
Referenced by UI_view2d_scrollers_draw_ex().
Definition at line 1608 of file view2d.cc.
References UI_view2d_scrollers_draw_ex().
Definition at line 1515 of file view2d.cc.
References View2D::alpha_hor, View2D::alpha_vert, BLI_rcti_size_x(), BLI_rcti_size_y(), View2DScrollers::hor, View2DScrollers::hor_max, View2DScrollers::hor_min, uiWidgetColors::inner, uiWidgetColors::item, View2D::keepzoom, uiWidgetColors::outline, View2D::scroll, View2D::scroll_ui, state, TH_BACK, bTheme::tui, UI_draw_widget_scroll(), UI_GetTheme(), UI_GetThemeColor4ubv(), UI_SCROLL_ARROWS, UI_SCROLL_PRESSED, UI_view2d_scrollers_calc(), V2D_LOCKZOOM_X, V2D_LOCKZOOM_Y, V2D_SCROLL_H_ACTIVE, V2D_SCROLL_HANDLE_SIZE_HOTSPOT, V2D_SCROLL_HORIZONTAL, V2D_SCROLL_HORIZONTAL_HANDLES, V2D_SCROLL_MIN_ALPHA, V2D_SCROLL_V_ACTIVE, V2D_SCROLL_VERTICAL, V2D_SCROLL_VERTICAL_HANDLES, View2DScrollers::vert, View2DScrollers::vert_max, View2DScrollers::vert_min, view2d_scroll_mapped(), ThemeUI::wcol_scroll, ThemeUI::widget_emboss, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by UI_view2d_scrollers_draw().
void UI_view2d_sync | ( | struct bScreen * | screen, |
struct ScrArea * | area, | ||
struct View2D * | v2dcur, | ||
int | flag | ||
) |
Called by menus to activate it, or by view2d operators to make sure 'related' views stay in synchrony.
Definition at line 851 of file view2d.cc.
References blender::compositor::area(), bScreen::areabase, View2D::cur, ED_region_tag_redraw_no_rebuild(), View2D::flag, LISTBASE_FOREACH, UI_view2d_area_supports_sync(), V2D_LOCK_COPY, V2D_VIEWSYNC_AREA_VERTICAL, V2D_VIEWSYNC_SCREEN_TIME, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by actkeys_viewall(), clip_draw_dopesheet_channels(), draw_channel_names(), draw_nla_channel_list(), edge_pan_apply_delta(), nlaedit_viewall(), reset_exec(), scroller_activate_apply(), sequencer_view_all_preview_exec(), UI_view2d_edge_pan_cancel(), UI_view2d_smooth_view(), view2d_smoothview_invoke(), view_pan_apply_ex(), view_zoomdrag_apply(), and view_zoomstep_apply_ex().
void UI_view2d_text_cache_add | ( | struct View2D * | v2d, |
float | x, | ||
float | y, | ||
const char * | str, | ||
size_t | str_len, | ||
const unsigned char | col[4] | ||
) |
Cached text drawing in v2d, to allow pixel-aligned draw as post process.
Definition at line 2068 of file view2d.cc.
References BLI_assert, BLI_LINKS_PREPEND, BLI_memarena_alloc(), BLI_memarena_new(), View2DString::col, col, g_v2d_strings, g_v2d_strings_arena, MEM_SIZE_OPTIMAL, View2DString::mval, View2DString::pack, View2DString::rect, str, View2DString::str, UI_view2d_view_to_region_clip(), x, and y.
Referenced by draw_seq_handle(), and nla_draw_strip_frames_text().
void UI_view2d_text_cache_add_rectf | ( | View2D * | v2d, |
const rctf * | rect_view, | ||
const char * | str, | ||
size_t | str_len, | ||
const uchar | col[4] | ||
) |
Definition at line 2098 of file view2d.cc.
References BLI_assert, BLI_LINKS_PREPEND, BLI_memarena_alloc(), BLI_memarena_new(), View2DString::col, col, g_v2d_strings, g_v2d_strings_arena, MEM_SIZE_OPTIMAL, View2DString::mval, View2DString::pack, View2DString::rect, str, View2DString::str, UI_view2d_view_to_region_rcti_clip(), rcti::xmin, and rcti::ymin.
Definition at line 2128 of file view2d.cc.
References BLF_clipping(), BLF_CLIPPING, BLF_color3ubv(), BLF_default(), BLF_disable(), BLF_draw_default(), BLF_DRAW_STR_DUMMY_MAX, BLF_enable(), BLF_height(), BLF_set_default(), BLI_memarena_free(), BLI_rcti_size_y(), ceil(), View2DString::col, g_v2d_strings, g_v2d_strings_arena, View2DString::next, View2DString::pack, View2DString::rect, View2DString::str, View2DString::ub, wmOrtho2_region_pixelspace(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by draw_seq_in_view(), draw_timeline_seq(), and nla_main_region_draw().
Definition at line 1022 of file view2d.cc.
References height, UI_view2d_totRect_set_resize(), and width.
Referenced by console_textview_update_rect(), ED_region_header_layout(), ED_region_panels_layout_ex(), file_calc_previews(), info_textview_update_rect(), outliner_update_viewable_area(), sequencer_draw_preview(), and blender::ed::spreadsheet::update_view2d_tot_rect().
Change the size of the maximum viewable area (i.e. 'tot' rect).
Definition at line 963 of file view2d.cc.
References blender::math::abs(), View2D::align, ELEM, float(), G, G_DEBUG, height, View2D::tot, ui_view2d_curRect_validate_resize(), V2D_ALIGN_NO_NEG_X, V2D_ALIGN_NO_NEG_Y, V2D_ALIGN_NO_POS_X, V2D_ALIGN_NO_POS_Y, width, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by UI_view2d_region_reinit(), and UI_view2d_totRect_set().
Definition at line 1081 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rctf_translate(), BLI_rcti_size_x(), BLI_rcti_size_y(), View2D::cur, eps, View2D::flag, floorf, View2D::mask, V2D_PIXELOFS_X, V2D_PIXELOFS_Y, view2d_map_cur_using_mask(), wmOrtho2(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Set view matrices to only use one axis of 'cur' only
xaxis | if non-zero, only use cur x-axis, otherwise use cur-yaxis (mostly this will be used for x). |
Definition at line 1122 of file view2d.cc.
References view2d_map_cur_using_mask(), ARegion::winx, ARegion::winy, wmOrtho2(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by action_main_region_draw(), draw_timeline_seq(), graph_main_region_draw(), and nla_main_region_draw().
Definition at line 1148 of file view2d.cc.
References BLI_rcti_size_x(), BLI_rcti_size_y(), C, CTX_wm_region(), GPU_matrix_identity_set(), height, width, ARegion::winrct, and wmOrtho2().
void UI_view2d_view_to_region | ( | const View2D * | v2d, |
float | x, | ||
float | y, | ||
int * | r_region_x, | ||
int * | r_region_y | ||
) |
Definition at line 1721 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), clamp_float_to_int(), View2D::cur, View2D::mask, x, rcti::xmin, rctf::xmin, y, rcti::ymin, and rctf::ymin.
bool UI_view2d_view_to_region_clip | ( | const View2D * | v2d, |
float | x, | ||
float | y, | ||
int * | r_region_x, | ||
int * | r_region_y | ||
) |
Definition at line 1700 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), View2D::cur, View2D::mask, V2D_IS_CLIPPED, x, rcti::xmin, rctf::xmin, y, rcti::ymin, and rctf::ymin.
Referenced by UI_view2d_text_cache_add().
void UI_view2d_view_to_region_fl | ( | const View2D * | v2d, |
float | x, | ||
float | y, | ||
float * | r_region_x, | ||
float * | r_region_y | ||
) |
Definition at line 1737 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), View2D::cur, View2D::mask, x, rcti::xmin, rctf::xmin, y, rcti::ymin, and rctf::ymin.
Definition at line 1806 of file view2d.cc.
References BLI_rctf_rcti_copy(), BLI_rctf_transform_calc_m4_pivot_min(), View2D::cur, mask(), View2D::mask, and unit_m4().
Definition at line 1784 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), clamp_rctf_to_rcti(), View2D::cur, float(), View2D::mask, rctf::xmax, rcti::xmin, rctf::xmin, rctf::ymax, rcti::ymin, and rctf::ymin.
bool UI_view2d_view_to_region_rcti_clip | ( | const View2D * | v2d, |
const rctf * | rect_src, | ||
rcti * | rect_dst | ||
) |
Definition at line 1814 of file view2d.cc.
References BLI_assert, BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), clamp_rctf_to_rcti(), View2D::cur, float(), View2D::mask, V2D_IS_CLIPPED, rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, and rctf::ymin.
Referenced by UI_view2d_text_cache_add_rectf().
bool UI_view2d_view_to_region_segment_clip | ( | const View2D * | v2d, |
const float | xy_a[2], | ||
const float | xy_b[2], | ||
int | r_region_a[2], | ||
int | r_region_b[2] | ||
) |
Definition at line 1749 of file view2d.cc.
References BLI_rctf_isect_segment(), BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), View2D::cur, View2D::mask, V2D_IS_CLIPPED, rctf::xmax, rcti::xmin, rctf::xmin, rctf::ymax, rcti::ymin, and rctf::ymin.
Referenced by do_lasso_select_mesh_uv_is_edge_inside().
Definition at line 1689 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rcti_size_x(), View2D::cur, View2D::mask, x, rcti::xmin, and rctf::xmin.
Definition at line 1694 of file view2d.cc.
References BLI_rctf_size_y(), BLI_rcti_size_y(), View2D::cur, View2D::mask, y, rcti::ymin, and rctf::ymin.
Definition at line 1027 of file view2d.cc.
References BLF_cache_clear(), and G.
Referenced by reset_exec(), view2d_smoothview_invoke(), view_zoomdrag_exit(), view_zoomstep_exit(), and wm_file_read_pre().
Definition at line 1050 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), View2D::cur, float(), View2D::mask, View2D::scroll, view2d_scroll_mapped(), View2D::winx, View2D::winy, rcti::xmax, rctf::xmax, rcti::xmin, rctf::xmin, rcti::ymax, rctf::ymax, rcti::ymin, and rctf::ymin.
Referenced by UI_view2d_view_ortho(), and UI_view2d_view_orthoSpecial().
Called each time View2D.cur changes, to dynamically update masks.
mask_scroll | Optionally clamp scrollbars by this region. |
Definition at line 120 of file view2d.cc.
References BLI_rctf_size_x(), BLI_rctf_size_y(), View2D::cur, View2D::hor, View2D::mask, View2D::scroll, View2D::tot, UI_TIME_SCRUB_MARGIN_Y, UI_view2d_mask_from_win(), UI_view2d_scroller_size_get(), V2D_SCROLL_BOTTOM, V2D_SCROLL_HORIZONTAL_FULLR, V2D_SCROLL_HORIZONTAL_HANDLES, V2D_SCROLL_HORIZONTAL_HIDE, V2D_SCROLL_LEFT, V2D_SCROLL_RIGHT, V2D_SCROLL_TOP, V2D_SCROLL_VERTICAL, V2D_SCROLL_VERTICAL_FULLR, V2D_SCROLL_VERTICAL_HANDLES, V2D_SCROLL_VERTICAL_HIDE, View2D::vert, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by ui_view2d_curRect_validate_resize(), UI_view2d_region_reinit(), and UI_view2d_scrollers_calc().
|
static |
helper to allow scrollbars to dynamically hide
Definition at line 96 of file view2d.cc.
References V2D_SCROLL_HORIZONTAL, V2D_SCROLL_HORIZONTAL_FULLR, V2D_SCROLL_VERTICAL, and V2D_SCROLL_VERTICAL_FULLR.
Referenced by UI_view2d_mouse_in_scrollers_ex(), UI_view2d_rect_in_scrollers_ex(), UI_view2d_scroller_size_get(), UI_view2d_scrollers_calc(), UI_view2d_scrollers_draw_ex(), and view2d_map_cur_using_mask().
|
static |
Definition at line 2066 of file view2d.cc.
Referenced by UI_view2d_text_cache_add(), UI_view2d_text_cache_add_rectf(), and UI_view2d_text_cache_draw().
|
static |
Definition at line 2065 of file view2d.cc.
Referenced by UI_view2d_text_cache_add(), UI_view2d_text_cache_add_rectf(), and UI_view2d_text_cache_draw().