diff options
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 7d4aaf0c70e..d5515bd1cf8 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -500,7 +500,7 @@ static int view_selected_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene; Object *obedit; Image *ima; - float size, min[2], max[2], d[2]; + float size, min[2], max[2], d[2], aspx, aspy; int width, height; /* retrieve state */ @@ -511,6 +511,10 @@ static int view_selected_exec(bContext *C, wmOperator *UNUSED(op)) ima= ED_space_image(sima); ED_space_image_size(sima, &width, &height); + ED_image_aspect(ima, &aspx, &aspy); + + width= width*aspx; + height= height*aspy; /* get bounds */ if(!ED_uvedit_minmax(scene, ima, obedit, min, max)) @@ -645,6 +649,9 @@ static const EnumPropertyItem image_file_type_items[] = { {R_TARGA, "TARGA", 0, "Targa", ""}, {R_RAWTGA, "TARGA RAW", 0, "Targa Raw", ""}, {R_PNG, "PNG", 0, "PNG", ""}, +#ifdef WITH_DDS + {R_DDS, "DDS", 0, "DirectDraw Surface", ""}, +#endif {R_BMP, "BMP", 0, "BMP", ""}, {R_JPEG90, "JPEG", 0, "Jpeg", ""}, #ifdef WITH_OPENJPEG @@ -799,6 +806,7 @@ void IMAGE_OT_open(wmOperatorType *ot) { /* identifiers */ ot->name= "Open Image"; + ot->description= "Open image"; ot->idname= "IMAGE_OT_open"; /* api callbacks */ @@ -1342,6 +1350,7 @@ void IMAGE_OT_new(wmOperatorType *ot) /* identifiers */ ot->name= "New Image"; + ot->description= "Create a new image"; ot->idname= "IMAGE_OT_new"; /* api callbacks */ @@ -1420,6 +1429,9 @@ static int image_invert_exec(bContext *C, wmOperator *op) } ibuf->userflags |= IB_BITMAPDIRTY; + if(ibuf->mipmap[0]) + ibuf->userflags |= IB_MIPMAP_INVALID; + WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima); return OPERATOR_FINISHED; } @@ -1645,16 +1657,13 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event) ImBuf *ibuf= ED_space_image_acquire_buffer(sima, &lock); ImageSampleInfo *info= op->customdata; float fx, fy; - int mx, my; if(ibuf == NULL) { ED_space_image_release_buffer(sima, lock); return; } - mx= event->x - ar->winrct.xmin; - my= event->y - ar->winrct.ymin; - UI_view2d_region_to_view(&ar->v2d, mx, my, &fx, &fy); + UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy); if(fx>=0.0f && fy>=0.0f && fx<1.0f && fy<1.0f) { float *fp; @@ -1920,6 +1929,7 @@ void IMAGE_OT_sample_line(wmOperatorType *ot) ot->modal= WM_gesture_straightline_modal; ot->exec= sample_line_exec; ot->poll= space_image_main_area_poll; + ot->cancel= WM_gesture_straightline_cancel; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; |