Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/mask/mask_query.c
| Show First 20 Lines • Show All 483 Lines • ▼ Show 20 Lines | bool ED_mask_feather_find_nearest(const bContext *C, | ||||
| if (r_point) { | if (r_point) { | ||||
| *r_point = NULL; | *r_point = NULL; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* takes event->mval */ | |||||
| void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float co[2]) | void ED_mask_mouse_pos(ScrArea *area, ARegion *region, const int mval[2], float co[2]) | ||||
| { | { | ||||
| if (area) { | if (area) { | ||||
| switch (area->spacetype) { | switch (area->spacetype) { | ||||
| case SPACE_CLIP: { | case SPACE_CLIP: { | ||||
| SpaceClip *sc = area->spacedata.first; | SpaceClip *sc = area->spacedata.first; | ||||
| ED_clip_mouse_pos(sc, region, mval, co); | ED_clip_mouse_pos(sc, region, mval, co); | ||||
| BKE_mask_coord_from_movieclip(sc->clip, &sc->user, co, co); | BKE_mask_coord_from_movieclip(sc->clip, &sc->user, co, co); | ||||
| Show All 17 Lines | if (area) { | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_assert(0); | BLI_assert(0); | ||||
| zero_v2(co); | zero_v2(co); | ||||
| } | } | ||||
| } | } | ||||
| /* input: x/y - mval space | |||||
| * output: xr/yr - mask point space */ | |||||
| void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr) | void ED_mask_point_pos(ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr) | ||||
| { | { | ||||
| float co[2]; | float co[2]; | ||||
| if (area) { | if (area) { | ||||
| switch (area->spacetype) { | switch (area->spacetype) { | ||||
| case SPACE_CLIP: { | case SPACE_CLIP: { | ||||
| SpaceClip *sc = area->spacedata.first; | SpaceClip *sc = area->spacedata.first; | ||||
| ▲ Show 20 Lines • Show All 327 Lines • Show Last 20 Lines | |||||