Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_sequencer/sequencer_view.c
| Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| if (ibuf == NULL) { | if (ibuf == NULL) { | ||||
| IMB_freeImBuf(ibuf); | IMB_freeImBuf(ibuf); | ||||
| info->draw = 0; | info->draw = 0; | ||||
| return; | return; | ||||
| } | } | ||||
| UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy); | UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy); | ||||
| fx /= scene->r.xasp / scene->r.yasp; | |||||
| fx += (float)scene->r.xsch / 2.0f; | fx += (float)scene->r.xsch / 2.0f; | ||||
| fy += (float)scene->r.ysch / 2.0f; | fy += (float)scene->r.ysch / 2.0f; | ||||
| fx *= (float)ibuf->x / (float)scene->r.xsch; | fx *= (float)ibuf->x / (float)scene->r.xsch; | ||||
| fy *= (float)ibuf->y / (float)scene->r.ysch; | fy *= (float)ibuf->y / (float)scene->r.ysch; | ||||
| if (fx >= 0.0f && fy >= 0.0f && fx < ibuf->x && fy < ibuf->y) { | if (fx >= 0.0f && fy >= 0.0f && fx < ibuf->x && fy < ibuf->y) { | ||||
| const float *fp; | const float *fp; | ||||
| unsigned char *cp; | unsigned char *cp; | ||||
| ▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines | |||||