Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap.c
| Show First 20 Lines • Show All 1,557 Lines • ▼ Show 20 Lines | static void applyGridIncrement( | ||||
| if (fac[action] == 0.0f) { | if (fac[action] == 0.0f) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (use_aspect) { | if (use_aspect) { | ||||
| /* custom aspect for fcurve */ | /* custom aspect for fcurve */ | ||||
| if (t->spacetype == SPACE_GRAPH) { | if (t->spacetype == SPACE_GRAPH) { | ||||
| View2D *v2d = &t->ar->v2d; | View2D *v2d = &t->ar->v2d; | ||||
| View2DGrid *grid; | Scene *scene = t->scene; | ||||
| SpaceGraph *sipo = t->sa->spacedata.first; | SpaceGraph *sipo = t->sa->spacedata.first; | ||||
| int unity = V2D_UNIT_VALUES; | asp_local[0] = UI_view2d_grid_resolution_x__frames_or_seconds( | ||||
| int unitx = (sipo->flag & SIPO_DRAWTIME) ? V2D_UNIT_SECONDS : V2D_UNIT_FRAMESCALE; | v2d, scene, sipo->flag & SIPO_DRAWTIME); | ||||
| asp_local[1] = UI_view2d_grid_resolution_y__values(v2d); | |||||
| /* grid */ | |||||
| grid = UI_view2d_grid_calc(t->scene, | |||||
| v2d, | |||||
| unitx, | |||||
| V2D_GRID_NOCLAMP, | |||||
| unity, | |||||
| V2D_GRID_NOCLAMP, | |||||
| t->ar->winx, | |||||
| t->ar->winy); | |||||
| UI_view2d_grid_size(grid, &asp_local[0], &asp_local[1]); | |||||
| UI_view2d_grid_free(grid); | |||||
| asp = asp_local; | asp = asp_local; | ||||
| } | } | ||||
| } | } | ||||
| /* absolute snapping on grid based on global center */ | /* absolute snapping on grid based on global center */ | ||||
| if ((t->tsnap.snap_spatial_grid) && (t->mode == TFM_TRANSLATION)) { | if ((t->tsnap.snap_spatial_grid) && (t->mode == TFM_TRANSLATION)) { | ||||
| const float *center_global = t->center_global; | const float *center_global = t->center_global; | ||||
| bool use_local_axis = false; | bool use_local_axis = false; | ||||
| ▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines | |||||