Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
| Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | static bool gizmo_calc_rect_view_scale(const wmGizmo *gz, const float dims[2], float scale[2]) | ||||
| scale[0] = 1.0f / len_x_axis; | scale[0] = 1.0f / len_x_axis; | ||||
| scale[1] = 1.0f / len_y_axis; | scale[1] = 1.0f / len_y_axis; | ||||
| return true; | return true; | ||||
| } | } | ||||
| static bool gizmo_calc_rect_view_margin(const wmGizmo *gz, const float dims[2], float margin[2]) | static bool gizmo_calc_rect_view_margin(const wmGizmo *gz, const float dims[2], float margin[2]) | ||||
| { | { | ||||
| float handle_size; | float handle_size; | ||||
| handle_size = 10.0f; | handle_size = 0.15f; | ||||
| handle_size *= gz->scale_final; | handle_size *= gz->scale_final; | ||||
| float scale_xy[2]; | float scale_xy[2]; | ||||
| if (!gizmo_calc_rect_view_scale(gz, dims, scale_xy)) { | if (!gizmo_calc_rect_view_scale(gz, dims, scale_xy)) { | ||||
| zero_v2(margin); | zero_v2(margin); | ||||
| return false; | return false; | ||||
| } | } | ||||
| margin[0] = ((handle_size * scale_xy[0])); | margin[0] = ((handle_size * scale_xy[0])); | ||||
| margin[1] = ((handle_size * scale_xy[1])); | margin[1] = ((handle_size * scale_xy[1])); | ||||
| ▲ Show 20 Lines • Show All 1,098 Lines • Show Last 20 Lines | |||||